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

Add EXPLAIN output to sql sentry breadcrumbs #499

Merged
merged 4 commits into from Feb 12, 2020
Merged

Conversation

bloodearnest
Copy link
Contributor

Also fixes a bug where the name of the duration field was wrong in tests.

@wgrant
Copy link

wgrant commented Jan 7, 2020

I don't think this should be done unconditionally, or by default. It's quite expensive, as you end up doing twice as many queries as you otherwise would.

@bloodearnest
Copy link
Contributor Author

bloodearnest commented Jan 7, 2020

I was just writing a comment to this effect,

To clarify, the extra queries are a) only done after the request has finished b) only if a sentry report is generated, so infrequently. The main time this would be an issue AIUI is adding additional load to the DB when there is an outage that is generating lots of sentry requests, which is already a problem.

What condition do you think might work?

We are adding the X-Debug header in #498, perhaps we only do EXPLAIN when that is requested?

We could also maybe cache the EXPLAIN results per parameterised query string in LRU cache. Given it's not ANALYSE, the plan returned should be the same for all queries. And query structure should be fairly stable, per process launch.

@bloodearnest
Copy link
Contributor Author

Have put behind config, and also enabled by the new X-Debug header. That work for you @wgrant?

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.

None yet

2 participants