Kinto / kinto.js

An Offline-First JavaScript Client for Kinto.
http://kintojs.readthedocs.io/
Other
318 stars 72 forks source link

Allow defining local indexes. #66

Open n1k0 opened 9 years ago

n1k0 commented 9 years ago

Filtering and ordering being currently achieved in-memory, the performance penalty can be important in case of large datasets.

We should allow users to create indexes on fields and rely on native IDB queries to speed things up.

Suggested API:

const db = new Kinto();
const tasks = db.collection("tasks");
tasks.ensureIndexed("label", "done");

Or even:

const tasks = db.collection("tasks", {
  indexes: ["label", "done"]
});

Thoughts? @Natim @leplatrem

Natim commented 9 years ago

I like this idea because it helps speed up things for schemaless.

n1k0 commented 9 years ago

Something to pay attention to, because we'll alter the store schemas by adding/altering indexes, we'll need to handle database version numbers.

n1k0 commented 8 years ago

Note: since #315 and #318 has now landed, we should implement custom index definition so users can benefit from the performance improvement provided by leveraging idb indexes for filtering and sorting.

leplatrem commented 8 years ago

https://twitter.com/daleharvey/status/735062319126982658

capture d ecran de 2016-05-26 11-06-19

raevilman commented 1 year ago

any plans for this..?

PS: Coming from DexieJS

leplatrem commented 1 year ago

Not really. But if someone contributes it, we would definitely provide support to ship it :)