kinto.js icon indicating copy to clipboard operation
kinto.js copied to clipboard

Allow defining local indexes.

Open n1k0 opened this issue 10 years ago • 6 comments

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

n1k0 avatar Jul 15 '15 10:07 n1k0

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

Natim avatar Jul 15 '15 12:07 Natim

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 avatar Sep 07 '15 10:09 n1k0

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.

n1k0 avatar Feb 03 '16 15:02 n1k0

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

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

leplatrem avatar May 26 '16 09:05 leplatrem

any plans for this..?

PS: Coming from DexieJS

raevilman avatar Jul 09 '23 08:07 raevilman

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

leplatrem avatar Jul 11 '23 11:07 leplatrem