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

queries: unexplained plan oscillation when running MR tpcc #123157

Open
ajstorm opened this issue Apr 26, 2024 · 3 comments
Open

queries: unexplained plan oscillation when running MR tpcc #123157

ajstorm opened this issue Apr 26, 2024 · 3 comments
Labels
A-sql-optimizer SQL logical planning and optimizations. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-testcluster Issues found or occurred on a test cluster, i.e. a long-running internal cluster P-1 Issues/test failures with a fix SLA of 1 month T-sql-queries SQL Queries Team

Comments

@ajstorm
Copy link
Collaborator

ajstorm commented Apr 26, 2024

When running TPC-C on the drt-large cluster, we're seeing some unexpected plan oscillation for some of the queries. We saw this earlier in the run, shortly after we loaded the tables and before the statistics were run (#122818) but then a few days later, the plans briefly oscillated again.

image
image
image

Discussed in this internal thread.

Jira issue: CRDB-38218

@ajstorm ajstorm added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-sql-optimizer SQL logical planning and optimizations. T-sql-queries SQL Queries Team O-testcluster Issues found or occurred on a test cluster, i.e. a long-running internal cluster P-1 Issues/test failures with a fix SLA of 1 month labels Apr 26, 2024
@DrewKimball
Copy link
Collaborator

Note: I think the current poor plan choices are happening at a more or less constant, low rate. Most executions are using the "good" plan, while certain placeholder values are using the "bad" plan. Since these tables are very large, I suspect #97701 is involved.

@mgartner
Copy link
Collaborator

The UPDATE on "orders" can oscilate when stats are out of date and the o_w_id value being filtered is outside the histogram range, see #64570. Also see the discussion here: https://cockroachlabs.slack.com/archives/C01RX2G8LT1/p1714421477464499

@ajstorm
Copy link
Collaborator Author

ajstorm commented May 7, 2024

Reopening, based on a discussion with @mgartner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-optimizer SQL logical planning and optimizations. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-testcluster Issues found or occurred on a test cluster, i.e. a long-running internal cluster P-1 Issues/test failures with a fix SLA of 1 month T-sql-queries SQL Queries Team
Projects
Archived in project
Development

No branches or pull requests

3 participants