#Querying _creationTime range in large table

3 messages · Page 1 of 1 (latest)

naive lion
#

What are the suggested patterns for querying a large table by _creationTime?

I would like to specify a startTime and endTime but my current query still iterates over the whole table, which exceeds the limit and throws an error.

modest schooner
#

i think you can do await db.query("table").withIndex("by_creation_time", q => q.gt("_creationTime", lowerBound).lt("_creationTime", upperBound)),collect()

naive lion
#

worked like a charm, thanks!