cockroachdb / cockroachdb/cockroach

sql: write a test to compare query plans of prepared and simple statements

Open
#163,366 0 comments 0 reactions 0 assignees View on GitHub
A-prepared-stmts A-testing 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

We've seen a number of cases where query plans are significantly different between prepared and simple versions of the same query, even when generic query plans are not used. This is unexpected for users and represents a bit of a UX papercut. Ideally, we'd get the same good plan whether or not a query is prepared with placeholders of just using the simple protocol with all placeholders filled in. We should consider building a randomized test that compares the query plan of prepared and simple queries, which fails if the plans are significantly different (e.g., one plan has a full table scan and the other one doesn't).

Jira issue: CRDB-60187

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.