Skip to content
Snippets Groups Projects
Unverified Commit 538e5e38 authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

Optimize relative datetime filters (#14835)

1. Rename optimize-datetime-filters middleware -> optimize-temporal-filters (it's more accurate, because this also
optimizes date or time filter clauses)

2. optimize-temporal-filters middleware now optimizes relative-datetime clauses (which represent a moment in time
relative to when the query is ran, e.g. "last month") in addition to absolute-datetime clauses (which represent an
absolute moment in time, e.g. 2021-02-15T14:40:00-08:00) . This middleware rewrites queries so we filter against
specific temporal ranges without casting the column itself, meaning we can leverage indexes on that column. See #11837
for more details

3. Added new validate-temporal-bucketing middleware that throws an Exception if you try to do something that makes no
sense, e.g. bucket a DATE field by :time or a TIME field by :month. This is a better situation then running the query
and waiting for the DB to complain. (In practice, I don't think the FE client would let you generate a query like this
in the first place)

4. Fix random test failures for MySQL in task-history-cleanup-test
parent b4d8e35a
No related branches found
No related tags found
No related merge requests found
Showing
with 687 additions and 190 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment