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

chore(query): Add more timing measures #27528

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timgl
Copy link
Collaborator

@timgl timgl commented Jan 15, 2025

Problem

Add some more instrumentation so we know where things are slow

Changes

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

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

How did you test this code?

@timgl timgl requested a review from tkaemming January 15, 2025 00:34
Copy link

@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 adds comprehensive timing instrumentation to better track performance metrics in HogQL query execution. Here's a focused summary of the key changes:

  • Added timing measurements in create_hogql_database for critical operations like session table setup, data warehouse operations, and joins
  • Enhanced execute_hogql_query to propagate timing context through HogQLContext and database creation
  • Wrapped key database initialization sections in timings.measure() for granular performance tracking
  • Added instrumentation for group type mapping and channel/domain type creation
  • Improved timing visibility for data warehouse operations including saved queries and table setup

The changes are purely observability-focused and don't modify any core logic, making this a low-risk improvement for debugging performance issues.

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

2 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.

2 participants