[Bug] INCLUDE (non-key) index column referenced by a predicate is treated as valid
Les mainteneurs répondent en général sous 3 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 32/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- C
- Étoiles
- 1.4k
- Forks
- 265
- Merge moyen
- 3 j 22 h
- PR mergées (30 j)
- 82
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/cloudberry
-
[Bug] Expand fails to recognize user-defined tablespacesPeut-être pris @nix-oss l’a pris il y a 78 jours. Ouvertetype: Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
apache/cloudberry#1885 · 2 réactions ·
Les mainteneurs répondent en général sous 3 jours
-
gpexpand first stage fails: 'SyncPackages' object has no attribute 'ret' (extension sync never runs; regression)Peut-être pris @talmacschen-arch l’a pris il y a 139 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
apache/cloudberry#1825 ·
Les mainteneurs répondent en général sous 3 jours
-
type: Bug
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
apache/cloudberry#2235 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 3/5 Une demi-journée Accessibilité débutants 30/100
apache/cloudberry#2224 ·
Les mainteneurs répondent en général sous 3 jours
-
[Bug] GPORCA: “could not find MotionState” for correlated EXISTS with LIMIT and a scalar subqueryPeut-être pris @Alena0704 l’a pris il y a 6 jours. Ouvertetype: Bug
apache/cloudberry#2221 · 1 personne assignée ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de apache/cloudberry
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
containers/bubblewrap#826 ·
Les mainteneurs répondent en général sous 1 jour
-
[compiler-rt] Rtsan-aarch64-NoInstTest: error: no such file or directory: 'NOTFOUND' (libatomic)Ouvertebuild-problem compiler-rt:rtsan platform:linux
Difficulté 2/5 1-3 heures Accessibilité débutants 63/100
llvm/llvm-project#239039 ·
Les mainteneurs répondent en général sous 1 jour
-
component:obi contribfest go test
Difficulté 2/5 Moins d'une heure Accessibilité débutants 83/100
open-telemetry/opentelemetry-ebpf-instrumentation#4143 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
checkpoint-restore/criu#3304 ·
Les mainteneurs répondent en général sous 1 jour
-
Separate Installation Commands into Individual Code BlocksPeut-être pris @andrySD l’a pris aujourd’hui. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
colbymchenry/codegraph#3241 ·
Les mainteneurs répondent en général sous 1 jour