Help

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

Topic Labels: API
Solved
Jump to Solution
1239 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Mateusz_Kobos
4 - Data Explorer
4 - Data Explorer

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
Bill_French
17 - Neptune
17 - Neptune

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
Bill_French
17 - Neptune
17 - Neptune

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.