issue with query in deta base with 20000 rows #441
-
Hi. I have created a deta base with about 20000 rows. They are all inserted with a unix timestamp and for debugging i added year, month, day integer fields also. The years range from 1990->2023. And I added them to the database from oldest to newest based on date. I notices when I query something with like {year:2020} or {year?gte:2015}, I do not get any results. While query {year:2000} return results as expected. When debugging this I noticed that the result i get from {year:2020} for example is: So I made a loop while last key was present and then finally got the result i wanted after 6 loops. Is this expected behaviour when using querys or is this a bug? For example when using the UI to query you cannot get any results at all when querying items that are stored last in the database. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
hello @ristomitts this is expected behavior (although inconvenient sorry). Base scans through upto 1 MB(without applying any queries) and then applies the query your provided. If the 1 MB scanned data does not have any items that match your query, it returns this reponse with no items and a We realize this is not ideal. This is due to a technical limitation at the moment and we plan to mitigate this issue as soon as we can. |
Beta Was this translation helpful? Give feedback.
hello @ristomitts this is expected behavior (although inconvenient sorry).
Base scans through upto 1 MB(without applying any queries) and then applies the query your provided. If the 1 MB scanned data does not have any items that match your query, it returns this reponse with no items and a
last
key scanned (meaning further items are to be scanned).We realize this is not ideal. This is due to a technical limitation at the moment and we plan to mitigate this issue as soon as we can.