[Bug] INCLUDE (non-key) index column referenced by a predicate is treated as valid
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
Direzione di ricerca
The bug is in GPORCA's construction of index conditions, and the issue suspects CXformUtils::PdrgpcrIndexColumns, which merges key and INCLUDE columns into one array. Reproduce the two SELECT statements with optimizer on and compare against optimizer off, then check which Index Cond the plan builds and where nodeIndexscan.c rejects it. Done means both queries return rows under optimizer=on without either sanity-check error. The issue reports an unmerged local fix but does not name a target design, so confirm the expected behaviour with maintainers first.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Apache Cloudberry version
No response
What happened
A GPORCA bug: an INCLUDE (non-key) index column referenced by a predicate is treated as a valid
index key column when building an Index Cond (likely via CXformUtils::PdrgpcrIndexColumns, which
concatenates key and included columns into one array with no marker distinguishing the two). The
resulting plan carries a scan key against an attribute beyond indnkeyatts, which the executor
rejects. Which sanity check fires depends on the predicate, so one bug produces two error
messages -- both are suppressed below:
CREATE TABLE t(a int, b ); CREATE INDEX i ON t USING btree (a) INCLUDE (b);
SET optimizer = on;
SELECT a FROM t WHERE b; -- b boolean: "bogus index qualification (nodeIndexscan.c)"
SELECT a FROM t WHERE b IS NULL; -- b int: "btree index keys must be ordered by attribute"
Verified scope: optimizer=on only (the Postgres planner never builds such an Index Cond, and
every case above returns the correct rows under optimizer=off); not specific to a distribution
policy (DISTRIBUTED BY and DISTRIBUTED REPLICATED both reproduce); needs no data, an empty table
is enough; and the INCLUDE list does not have to overlap the key columns -- a plain
"INCLUDE (b)" is sufficient. A fix exists locally but has not been merged into the Cloudberry
main branch this environment is built from.
What you think should happen instead
No response
How to reproduce
CREATE TABLE t(a int, b int); CREATE INDEX i ON t USING btree (a) INCLUDE (b);
SET optimizer = on;
SELECT a FROM t WHERE b IS NULL; -- b int: "btree index keys must be ordered by attribute"
Operating System
any
Anything else
No response
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
- 260
- Merge medio
- 4g 13h
- PR unite (30g)
- 56
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi 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
-
[Bug] Expand fails to recognize user-defined tablespacesForse già presa @nix-oss l’ha presa 58 giorni fa. Apertatype: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/cloudberry#1885 · 2 reazioni ·
I maintainer di solito rispondono entro 3 giorni
-
gpexpand first stage fails: 'SyncPackages' object has no attribute 'ret' (extension sync never runs; regression)Forse già presa @talmacschen-arch l’ha presa 119 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
apache/cloudberry#1825 ·
I maintainer di solito rispondono entro 3 giorni
-
type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
apache/cloudberry#2135 ·
I maintainer di solito rispondono entro 3 giorni
-
[Bug] REINDEX DATABASE CONCURRENTLY breaks temporary PAX tables created with ON COMMIT DELETE ROWSApertatype: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
apache/cloudberry#2134 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
apache/cloudberry#2130 ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di apache/cloudberry
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
`inverse()` of a controlled `CUGate` drops the phase parameter γForse già presa @rupasri118 l’ha presa oggi. Apertabug mod: circuit
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Qiskit/qiskit#17223 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
OpenPrinting/libcupsfilters#284 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
libsdl-org/SDL#16530 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
FriendsofECCE/ECCE#336 · 1 commento ·