#Confirmation regarding filtering on paginated queries
1 messages · Page 1 of 1 (latest)
In other words, will the following .filter perform a full table scan or scan through the initialNumItems setting in the paginationOpts
users = await db
.query("users")
.filter((q) => q.neq(q.field("name"), "Alex"))
.order("desc")
.paginate(paginationOpts);
It will scan the table until it finds initialNumItems that satisfy the filter. If most people have name!=Alex, it will read approximately initialNumItems. If most people are named Alex, it may scan the entire table. (edited because i missed the q.neq)