cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.96k stars 3.79k forks source link

sql: use histograms for joins #41204

Open awoods187 opened 5 years ago

awoods187 commented 5 years ago

Using histograms for joins will improve the ability of the CBO to pick the correct plan and therefore pick the best query which has the lowest latency and best performance for users.

We need to perform some experiments to understand the impact as well as level of effort. This may also be needed for all operators.

Epic CRDB-16930

Jira issue: CRDB-5481

Jira issue: CRDB-13894

rytaft commented 3 years ago

Note that we use histograms to estimate the size of join inputs (assuming the inputs are scans/selects), but we don't yet use histograms to estimate the output cardinality or output data distribution of joins.

github-actions[bot] commented 9 months ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!

mgartner commented 8 months ago

@rytaft Can you post a draft PR of the work you've done on this so it's not lost? Thanks!