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

[Feature Request] Optimizer for sortable TAG field #4376

Open
keithchew opened this issue Jan 22, 2024 · 3 comments
Open

[Feature Request] Optimizer for sortable TAG field #4376

keithchew opened this issue Jan 22, 2024 · 3 comments
Assignees

Comments

@keithchew
Copy link
Contributor

I have been testing the new sortby Optimizer and so far have been very happy with the results, achieving performance gains up to 100x in some use cases.

Currently the optimizer only applies to numeric fields in the sortby, I would like some information or thoughts on whether the optimizer can be extended to cover tag fields.

Perhaps initially just some feedback on whether this is feasible or not, and if yes, I would be happy to jump deeper into the code and do some experiments.

@adrianoamaral
Copy link
Collaborator

hey @keithchew thanks for reaching out! Glad that you're playing with the Sort optimisations. I would love to hear your inputs for the TAG implementation.

@keithchew
Copy link
Contributor Author

keithchew commented Jan 24, 2024

Hi @adrianoamaral

Currently, I only have the dataset which I plan to use for the test, ie creating 2mil sets with both numeric and tag numbers:

hset test:1 fnum "1" ftag "0000001"
hset test:2 fnum "2" ftag "0000002"
...
hset test:2000000 fnum "2000000" ftag "2000000"

then, using the profile to compare:

ft.profile test:idx search query "*" sortby fnum desc WITHOUTCOUNT limit 0 5
ft.profile test:idx search query "*" sortby ftag desc WITHOUTCOUNT limit 0 5

The first profile will be optimized as it has a numeric field. The second will not be optimized as it is not numeric, but hopefully with an enhancement to the Optimizer, it can be improved to be comparable to the first.

Copy link

This issue is stale because it has been open for 60 days with no activity.

@github-actions github-actions bot added the stale label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants