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
Time-based constraint exclusion doesn't work with NOW() or intervals over timezone types #118
Comments
Follow-up: The interval issue at least seems closely related to the fact that we're dealing with timestamps: So if you define your time colume as "timestamp without time zone", the interval issue doesn't occur:
Notice that the planner only touched 1 of the chunks, rather than all three. You still can't use the
|
Addressed in 0.4.0 release: https://github.com/timescale/timescaledb/releases/tag/0.4.0 |
The above examples actually conflate two things: In the one example
the problem was that it was actually mixing types ( So the queries given above with |
major performance hit in timescaledb for some queries when timestamp with time zone is used: timescale/timescaledb#118 (comment)
118: Adding fuzzing test for tdigest r=WireBaron a=WireBaron This also includes fixes for numerous found issues. Co-authored-by: Brian Rowe <brian@timescale.com>
Timescale's planner should eliminate many chunks via constraint exclusion based on their time intervals. This works correctly when the WHERE conditional provides a
timestamp
, but not adate
orinterval
type.In the following hypertable, I have three chunks covering different time intervals.
The following works correctly:
The following is incorrect:
I see similar incorrect behavior when performing the following:
We expected such behavior when including the conditional
NOW()
in the where clause, as the planner might not be able to evaluate that as a constant when generating its plan (e.g., due to prepared statements). But that same issue doesn't obviously apply to the above?The text was updated successfully, but these errors were encountered: