Question

Trying to figure indexedDB out, and not sure whether the following is possible whatsoever:

c=y and b<x and c>x

where a, b and c are properties in indexedDB and x is from javascript. c is already limiting this to only around 5 records, so right now I am pulling all of those in and doing the evaluation in javascript, however it seems unlikely there isn't a better way to do this.

Just to give an example what this could look like is an employees datastore with a employment_start and employment_end year and wanting to query for all employees in the year x working for division y.

(Solutions in ydn-db are fine as well, and just for clarity, this is the 'opposite' of my other question, where I had a range in javascript and single properties in indexedDB.)

Was it helpful?

Solution

Index base query exists not more than one range query. It is also true for SQL databases as well. They will have to use buffer to execute the query.

You will use index for one of the range query base on database statistic. Another range query will be on in-memory query. You can use ydn.db.Buffer. ydn.db.Buffer suppose to have dual on in-memory and temp-database buffering. Currently it is not. Anyways, in-memory is quite usable until around several ten thousands of keys. These buffered keys are sorted, either by secondary and primary keys.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top