-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: turns out prewhere and where filtering for the same property is no bueno #19472
Conversation
-- make sure we don't get the occasional unexpected future event | ||
AND e.timestamp <= now() | ||
-- and then any time filter for the events query | ||
{events_timestamp_clause} | ||
WHERE | ||
notEmpty(`$session_id`) | ||
{events_timestamp_clause} | ||
{event_filter_where_conditions} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shifted the timestamp clause up into the prewhere here
-- regardless of what other filters are applied | ||
-- limit by storage TTL | ||
AND e.timestamp >= %(clamped_to_storage_ttl)s | ||
-- make sure we don't get the occasional unexpected future event | ||
AND e.timestamp <= now() | ||
-- and then any time filter for the events query |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copied the comments up here to make the duplication more obvious so it'll annoy me and I can extract it next time I'm changing this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂
…no bueno (#19472) * fix: turns out prewhere and where filtering for the same property is no bueno * only not like an idiot
so, moves all of the timestamp filtering into the prewhere for the session events query (interestingly the log_entries query already did this)
@fuziontech figured this out during an incident