Skip to content
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

feat: Speed up problem results by combining responses into one CTE #35

Closed
wants to merge 1 commit into from

Conversation

bmtcril
Copy link
Contributor

@bmtcril bmtcril commented Dec 4, 2023

This change was based on a recommendation from Altinity, tests showed about a 30% speedup but I'm not 100% sure it's correct on a larger dataset so putting it up for comment while I test.

@bmtcril bmtcril marked this pull request as draft December 4, 2023 16:13
@bmtcril
Copy link
Contributor Author

bmtcril commented Dec 4, 2023

@bmtcril
Copy link
Contributor Author

bmtcril commented Jan 3, 2024

@SoryRawyer this is out of date, but I think we should still look at making these changes anywhere we're doing multiple CTEs and can combine them. It was a pretty marked performance difference.

@SoryRawyer
Copy link
Contributor

Ah sorry for letting this get past me, I must have thought this was shelved for a while. At first pass it looks good but I'll take a deeper look.

@SoryRawyer
Copy link
Contributor

@bmtcril did Altinity say anything about using window functions in views? I might be missing something, but I'm not sure that was ever resolved. That said, I think this is a good strategy for some of the more complicated Superset datasets like the one you linked to.

Comment on lines +20 to +23
if(
was_successful,
minIf(emission_time, was_successful),
maxIf(emission_time, not was_successful)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this double if necessary?

Suggested change
if(
was_successful,
minIf(emission_time, was_successful),
maxIf(emission_time, not was_successful)
if(
was_successful,
min(emission_time),
max(emission_time)

@bmtcril bmtcril closed this Jan 12, 2024
@bmtcril bmtcril deleted the bmtcril/speed_up_problem_responses branch March 6, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants