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

perf: Swap CROSS JOIN table ordering back to previous version #28404

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tkaemming
Copy link
Contributor

Problem

This may be the cause for recent problematic memory increases on EU cluster as noted as a possibility in #27890.

Changes

Reverts back to the slower but more memory optimized version.

Does this work well for both Cloud and self-hosted?

Yes.

How did you test this code?

Snapshots, et cetera

@tkaemming tkaemming marked this pull request as ready for review February 6, 2025 23:00
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR reverts a previous optimization in the query execution order to address memory usage concerns in the EU cluster, specifically affecting CROSS JOIN operations in trend analysis queries.

  • Reverts table ordering in _actors_inner_select_query method to prioritize memory efficiency over speed
  • Change primarily impacts queries using 'monthly_active' math operations which require storing 16-byte UUIDs for distinct count aggregations
  • Trades off ~10x performance improvement for lower memory consumption, particularly important for memory-constrained environments
  • Addresses potential memory issues reported in EU cluster while maintaining functionality across both cloud and self-hosted deployments

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

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.

1 participant