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

Partial/selective indexes #42

Closed
ddorian opened this issue Aug 10, 2016 · 3 comments
Closed

Partial/selective indexes #42

ddorian opened this issue Aug 10, 2016 · 3 comments

Comments

@ddorian
Copy link

ddorian commented Aug 10, 2016

What:
Like postgresql has: https://www.postgresql.org/docs/current/static/indexes-partial.html
Why:
To create smaller/specialiazed/faster indexes (or just index subset of table).
Example:
Move heavy-user's items to it's own index. Create a small index for "last hour" data (will require deleting of old indexes).
How:
By using the current partition-index http://doc.elassandra.io/en/latest/mapping.html#partitioned-index. Modifying it so if the function returns Null or empty-string, no indexing is done into es.

Makes sense ?

@vroyer
Copy link
Collaborator

vroyer commented Aug 10, 2016

Yes, in elassandra, if a partition function return an index name unavailable (does not exist, is closed or not writable), data is not indexed (for this partition function, but you can set many partition functions with different names).

If you don't want to delete old indices but continue to search in it, you can also set a index.block.write=true (a dynamic index setting), and new data won't be indexed in that index (but still in some other if there is....)

index partition function works fine for time-frame indices, its easy to delete later on, but also for any other split rule, like per-user index or per-country index with any dedicated mapping or access rules...

@ddorian
Copy link
Author

ddorian commented Aug 11, 2016

Hmm, I thought the partition function also created the index if it didn't exist. Wouldn't it make more sense to automatically create the index if it doesn't exist ?
And not create an index when it returns Null/empty-string ?

@vroyer
Copy link
Collaborator

vroyer commented Aug 13, 2016

Keep in mind that creating an index involve a PAXOS transaction to update the mapping, so you cannot afford this from many indexing threads.

@vroyer vroyer closed this as completed Aug 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants