Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

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

Topic Labels: API
Solved
Jump to Solution
855 1
cancel
Showing results for 
Search instead for 
Did you mean: 

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)?

1 Solution

Accepted Solutions

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.

See Solution in Thread

1 Reply 1

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.