cockroachdb / cockroachdb/cockroach

sql: randomized performance test for plan_cache_mode=auto

Open
#158,273 0 comments 0 reactions 0 assignees View on GitHub
C-enhancement O-postmortem P-3 T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

In order to find cases where `plan_cache_mode=auto` results in generic query plans which perform worse than their corresponding custom query plans, we could performed randomized tests that:

1. Generate a random schema and data.
2. Generate a random queries.
3. For each query:
a. Run it 6 times.
b. If a generic plan is chosen on the 6th execution, fail the test if it is significantly slower than the first 5 executions.

For 3b, comparing query latency might lead to flaky tests. Instead, we could compare the total number of rows decoded from KV, which should be more deterministic.

Jira issue: CRDB-57214

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.