[Performance]: Join estimates ignore cross-column correlation after ANALYZE (MOTR repro)
I maintainer di solito rispondono entro 1 giorno
@jiangxinmeng1 ci sta già lavorando.
Dal 25/11/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Summary
A deterministic MOTR case on MatrixOne main shows that a multi-table join estimate does not respond when the fact table's joint key distribution changes, even though each join-key column's marginal frequency (including NULL counts) is preserved. This extends the single-column skew issue in #31994 with a distinct cross-column correlation boundary.
Reproduction and evidence
The local MOTR fixture is 10_optimizer.s-4_7.
- Build 10,000 fact rows: 90% initially use the hot/hot key pair; the remaining rows span 10 regions and 50 customers, with 0.1% NULL join keys.
- Give both dimension tables duplicate hot keys and NULL-key controls.
- Move customer values between 1,000 hot-region and 1,000 tail-region rows. This preserves the per-column marginal frequencies but changes their correlation.
- Run the three-table equi-join before the update, after the update with stale stats, and after
ANALYZE TABLE fact.
Observed on MatrixOne main commit ca5325ce683a60ef6d7f0888b68d709de2ea8389:
| State | EXPLAIN estimated join rows | Actual joined rows |
|---|---|---|
| Initial hot/hot + tail/tail correlation | 2,734.69 | 36,990 |
| Changed correlation, before ANALYZE | 2,734.69 | 35,960 |
| Changed correlation, after ANALYZE | 2,734.69 | 35,960 |
SQL results are correct. The estimate is about 13.5x low initially and 13.1x low after the distribution change. Refreshing single-column statistics does not improve it because the marginals are unchanged. Runtime impact has not been measured on a larger workload, so this is a demonstrated cardinality/plan-quality issue, not a confirmed latency regression.
Expected behavior
The optimizer should account for cross-column dependence when estimating joins, or expose conservative uncertainty when available statistics cannot model it. A regression should compare actual rows and plans across correlated and uncorrelated controls without pinning a full EXPLAIN or query-specific join order.
Related issues
- #31994 — single-column skew and uniform selectivity estimates.
- #26768 — optimizer roadmap, including multi-column NDV/correlation statistics and join cardinality estimation.
- Supersedes #33237, which was created under the wrong GitHub identity.
Validation
MOTR 10_optimizer.s-4_7 passed on the main build for baseline recording and a non-recording rerun (27 statements). EXPLAIN output was inspected diagnostically and is not pinned as an exact plan baseline.
- Lingua principale
- Go
- Stelle
- 1.9k
- Fork
- 312
- Merge medio
- 21h 57m
- PR unite (30g)
- 730
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di matrixorigin/matrixone
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
matrixorigin/matrixone#33363 ·
I maintainer di solito rispondono entro 1 giorno
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
matrixorigin/matrixone#33362 ·
I maintainer di solito rispondono entro 1 giorno
-
SLEEP rejects NULL and negative durations that MySQL acceptsForse già presa @XuPeng-SH l’ha presa 8 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
matrixorigin/matrixone#32653 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Shared CI loses Coverage results during GitHub throttling and runs 4.2-dev with the wrong GoForse già presa @XuPeng-SH l’ha presa oggi. Aperta
matrixorigin/matrixone#33416 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: RENAME COLUMN leaves stale partition expression and unreplayable SHOW CREATEForse già presa @matrix-meow l’ha presa oggi. Apertakind/bug needs-triage
matrixorigin/matrixone#33397 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di matrixorigin/matrixone
Issue simili
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Windows系统上,希望复制路径增加 Unix 格式Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
go good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Azure/prometheus-collector#1828 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni