Jan 22, 2021 02:24 AM
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)?
Solved! Go to Solution.
Jan 22, 2021 02:39 AM
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.
Jan 22, 2021 02:39 AM
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.