I am using SQLDelight in my mobile app. The items which are being stored in the table have an id parameter. Say the count of items can go upto a few hundred, how expensive can the lookup for a particular item by its id will be? Is this strategy to look for an item by its id scalable for large tables when using SQLDelight? Assume that the id of different items form an increasing sequence. (1,2,3 ......etc)
Asked
Active
Viewed 71 times
0
-
i doubt `upto a few hundred` is really going to make a difference, most likely this is already happening on a background thread so worst case like a second or two, at the absolute absolute most – a_local_nobody Mar 14 '22 at 15:31
-
@a_local_nobody Upto what database size can this strategy work? Say upto a few thousands too? Or should I look for more alternatives? – Logging device Mar 14 '22 at 15:57
-
i highly doubt this is going to have an impact on performance to the point that you need to worry about this, the great thing is that you can actually test this yourself to see, flood your db with 10k+ records and see how long it takes. perhaps you can add an index to a column or something to improve performance, for all we know there's complicated logic inside the db to even make this as efficient as possible, it might not be iterating over every item like we think it does – a_local_nobody Mar 14 '22 at 16:17