Skip to content
Snippets Groups Projects
  • Cam Saul's avatar
    538e5e38
    Optimize relative datetime filters (#14835) · 538e5e38
    Cam Saul authored
    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
    Optimize relative datetime filters (#14835)
    Cam Saul authored
    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
Code owners
Assign users and groups as approvers for specific file changes. Learn more.