Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow defining local indexes. #66

Open
n1k0 opened this issue Jul 15, 2015 · 4 comments

Comments

@n1k0
Copy link
Contributor

commented Jul 15, 2015

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 n1k0 added this to the 1.0.0 milestone Jul 15, 2015

@Natim

This comment has been minimized.

Copy link
Member

commented Jul 15, 2015

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

@n1k0 n1k0 modified the milestone: 1.0.0 Sep 4, 2015

@n1k0

This comment has been minimized.

Copy link
Contributor Author

commented Sep 7, 2015

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 n1k0 added this to the 2.0.0 milestone Sep 7, 2015

@n1k0 n1k0 added the enhancement label Sep 7, 2015

@n1k0

This comment has been minimized.

Copy link
Contributor Author

commented Feb 3, 2016

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 leplatrem modified the milestone: 2.0.0 May 3, 2016

@leplatrem

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.