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

Long optimizer runtimes due slow cardinality estimation #2626

Open
dey4ss opened this issue Jan 12, 2024 · 0 comments
Open

Long optimizer runtimes due slow cardinality estimation #2626

dey4ss opened this issue Jan 12, 2024 · 0 comments

Comments

@dey4ss
Copy link
Member

dey4ss commented Jan 12, 2024

While working on #2590, we noticed that the optimizer runtimes for TPC-C are quite high and often, predicate reordering takes long (especially for TPC-C and JOB, see below). After some investigation, we found that cardinality estimation is a bottleneck for TPC-C queries.

One problem is that we copy histograms every time we scale or slice them, which could be improved with a histogram that references an original one (like a ReferenceSegment) and adds a selectivity and/or bucket ranges to perform estimations.

Join ordering and chunk pruning are also heavy hitters and guess what, these rules also do a lot of cardinality estimation (join ordering) or statistics pruning/slicing (chunk pruning).

Benchmarks are conducted on 8783047 (after already speeding up predicate reordering a bit).

TPC-C

tpcc_master_breakdown.pdf
tpcc_master_breakdown
tpcc_master_optimizer_breakdown.pdf
tpcc_master_optimizer_breakdown

TPC-DS

tpcds_master_breakdown.pdf
tpcds_master_breakdown
tpcds_master_optimizer_breakdown.pdf
tpcds_master_optimizer_breakdown

JOB

job_master_breakdown.pdf
job_master_breakdown
job_master_optimizer_breakdown.pdf
job_master_optimizer_breakdown

SSB

ssb_master_breakdown.pdf
ssb_master_breakdown
ssb_master_optimizer_breakdown.pdf
ssb_master_optimizer_breakdown

TPC-H SF 10

tpch_master_breakdown.pdf
tpch_master_breakdown
tpch_master_optimizer_breakdown.pdf
tpch_master_optimizer_breakdown

TPC-H SF 0.01

TBD

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

No branches or pull requests

1 participant