You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update ClickBench queries to avoid to_timestamp_seconds #15465
SELECT*FROM hits WHERE"URL"LIKE'%google%'ORDER BY to_timestamp_seconds("EventTime") LIMIT10;
However that function does timestamp validation and potentially slows down queries and prevents other optimizations (for example what @adriangb is doing in #15301)
However that function does timestamp validation and potentially slows down queries and prevents other optimizations (for example what @adriangb is doing in #15301)
I'm very curious about why this optimization is being blocked.
However that function does timestamp validation and potentially slows down queries and prevents other optimizations (for example what @adriangb is doing in #15301)
I'm very curious about why this optimization is being blocked.
I think it is because we don't have the analysis to translate the min(to_timestamp_seconds(column)) into a column < [current topk min heap value]
I think it is because we don't have the analysis to translate the min(to_timestamp_seconds(column)) into a column < [current topk min heap value]
So, should this situation be optimized as well?
I looked at the EventTime field in the hits dataset and found nothing special about it other than that it’s of type int64. I’m not quite sure why ORDER BY to_timestamp_seconds("EventTime") is used. I know this function converts the field to the timestamp type, but I don’t understand the significance of doing so.
I also saw other statements containing to_timestamp_seconds("EventTime"). Do those statements need to be modified?
Another discrepancy I found in the queries is the "EventDate"::INT::DATE" casting. Is this something we could remove as well? Maybe would be good to look at all further that are applied to the queries and undo them if possible (or file issues when the planner fails to plan them).
Another discrepancy I found in the queries is the "EventDate"::INT::DATE" casting. Is this something we could remove as well? Maybe would be good to look at all further that are applied to the queries and undo them if possible (or file issues when the planner fails to plan them).
Activity
acking-you commentedon Mar 27, 2025
I'm very curious about why this optimization is being blocked.
acking-you commentedon Mar 27, 2025
take
alamb commentedon Mar 27, 2025
I think it is because we don't have the analysis to translate the
min(to_timestamp_seconds(column))into acolumn < [current topk min heap value]acking-you commentedon Mar 28, 2025
So, should this situation be optimized as well?
I looked at the
EventTimefield in the hits dataset and found nothing special about it other than that it’s of type int64. I’m not quite sure whyORDER BY to_timestamp_seconds("EventTime")is used. I know this function converts the field to thetimestamptype, but I don’t understand the significance of doing so.I also saw other statements containing
to_timestamp_seconds("EventTime"). Do those statements need to be modified?Dandandan commentedon Mar 29, 2025
Another discrepancy I found in the queries is the "EventDate"::INT::DATE" casting. Is this something we could remove as well? Maybe would be good to look at all further that are applied to the queries and undo them if possible (or file issues when the planner fails to plan them).
alamb commentedon Mar 31, 2025