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

Queries are never cached when date math expressions are used (including exact dates) #9269

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@jpountz
Contributor

jpountz commented Jan 13, 2015

The query cache has a mechanism that disables it automatically when
SearchContext.nowInMillis() is used. One issue with that is that the date math
parser always evaluates the current timestamp when parsing a date, even if it
is not needed. As a consequence, whenever you use a date expression in your
queries, the query cache would not be used.

Close #9225

Query cache: Make the query cache usable on time-based data.
The query cache has a mechanism that disables it automatically when
SearchContext.nowInMillis() is used. One issue with that is that the date math
parser always evaluates the current timestamp when parsing a date, even if it
is not needed. As a consequence, whenever you use a date expression in your
queries, the query cache would not be used.

Close #9225
@bleskes

This comment has been minimized.

Member

bleskes commented Jan 13, 2015

LGTM. Good catch. The only thing I would recommend is changing the title of the PR to something less generic and more descriptive of the actual problem - like 'Queries are not cached when exact date values are used`

@jpountz jpountz changed the title from Query cache: Make the query cache usable on time-based data. to Query cache: Queries are never cached when date math expressions are used (including exact dates) Jan 13, 2015

@jpountz

This comment has been minimized.

Contributor

jpountz commented Jan 13, 2015

LGTM. Good catch.

All the fame should go to @ppf2

I just updated the title.

@jpountz jpountz added >bug and removed review labels Jan 13, 2015

@jpountz jpountz closed this Jan 19, 2015

@jpountz jpountz added v1.4.5 and removed v1.4.3 labels Feb 26, 2015

@jpountz

This comment has been minimized.

Contributor

jpountz commented Feb 26, 2015

Changing labels: the bug still existed on 1.4 due to a badly resolved merge conflict. So the fix will actually be in 1.4.5.

@clintongormley clintongormley changed the title from Query cache: Queries are never cached when date math expressions are used (including exact dates) to Queries are never cached when date math expressions are used (including exact dates) Jun 8, 2015

mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment