[Bug] ORCA: "bogus index qualification" when a filter on an INCLUDE-only index column is pushed into the index qual
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Riproduci il fallimento con l’esempio SQL, poi leggi nodeIndexscan.c intorno alla riga 1249 e confronta l’output di ORCA EXPLAIN con l’ottimizzatore disabilitato. La correzione è completa quando il filtro INCLUDE-only-column non causa più una qualificazione di indice errata e la query restituisce le due righe previste con entrambe le impostazioni dell’ottimizzatore.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Apache Cloudberry version
main branch (recent build)
What happened
With ORCA enabled, a query filtering on a column that is only an INCLUDE column of an index fails at execution time with an internal error:
ERROR: bogus index qualification (nodeIndexscan.c:1249)
ORCA generates an index scan on bogus_i and pushes c1 into the index qualification (EXPLAIN shows Index Cond: (c1 = true)), but c1 is a non-key INCLUDE column and ExecIndexBuildScanKeys rejects it. Line number is from current main. With optimizer = off the query returns the correct 2 rows.
Found by SQLancer.
What you think should happen instead
The query should return the two rows where c1 is true, with either optimizer.
How to reproduce
CREATE TABLE bogus_t (c0 boolean, c1 boolean);
CREATE INDEX bogus_i ON bogus_t (c0) INCLUDE (c1);
INSERT INTO bogus_t VALUES (true, true), (false, true), (true, false);
SET optimizer = on;
SELECT * FROM bogus_t WHERE c1;
-- ERROR: bogus index qualification (nodeIndexscan.c:1249)
SET optimizer = off;
SELECT * FROM bogus_t WHERE c1;
-- 2 rows
Operating System
Linux
Anything else
Found while running SQLancer against Cloudberry main (3-segment demo cluster, --enable-cassert). See the proposal to run SQLancer continuously: https://github.com/apache/cloudberry/discussions/1952
Are you willing to submit PR?
- Yes, I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- Lingua principale
- C
- Stelle
- 1.4k
- Fork
- 248
- Merge medio
- 4g 10h
- PR unite (30g)
- 40
Guida per i contributori
Apri la guida per i contributori
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 apache/cloudberry
-
type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/cloudberry#1885 · 2 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
apache/cloudberry#1825 ·
-
type: Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
apache/cloudberry#2048 · 1 reazione ·
-
type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 40/100
apache/cloudberry#2047 ·
-
type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
apache/cloudberry#2046 · 1 commento ·
Tutte le issue di apache/cloudberry
Issue simili
-
task
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vsanthanam/JBird#429 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
bug documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
es-ude/OnDeviceTraining#459 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
bilelmoussaoui/gobject-linter#199 · 1 commento ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bradcypert/plum#53 ·