1
0
mirror of https://github.com/timescale/timescaledb.git synced 2025-05-26 00:00:54 +08:00
timescaledb/.unreleased/fix-parameterized-time-bucket
Alexander Kuzmenkov de93e3916a Use parameterized time_bucket for chunk exclusion
When time_bucket is compared to constant in WHERE, we also add condition
on the underlying time variable (ts_transform_time_bucket_comparison).
Unfortunately we only do this for plan-time constants, which prevents
chunk exclusion when the interval is given by a query parameter, and a
generic plan is used. This commit also tries to apply this optimization
after applying the execution-time constants.

This PR also enables startup exclusion based on parameterized filters.
2024-01-19 19:39:13 +01:00

3 lines
177 B
Plaintext

Fixes: #6498 Suboptimal query plans when using time_bucket with query parameters
Thanks: @jbx1 for reporting suboptimal query plans when using time_bucket with query parameters