How fast is searching for a specific value in a field (column)?

I’m considering storing information about users in an Airtable table. One of the fields would contain a unique username. From my application, I would like to find the user that corresponds to a given username.

I think that the recommended approach would be to retrieve all records with a parameter filterByFormula= {Username}={My ID} as shown here. However, if I’m not mistaken, this would entail Airtable to scan all the rows of the table in order to find this particular record and thus would be very slow for a larger number of rows (O(n) complexity). Is this the case? Can I create an index (as in a relational database) to make such searches faster (O(log n) complexity)?

Hi @Mateusz_Kobos, and welcome to the community!

Yes, this is indeed the case. Assuming the process is using the REST API (not a script block or custom app), you would be wise to read all of the records one time, craft a hash index (like this) and then perform as many lookups as you like.

1 Like

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.