Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug] ORCA: "bogus index qualification" when a filter on an INCLUDE-only index column is pushed into the index qual

Aperta
#1,948 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, postgresql, sql
Ambito
databases

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

type: Bug type: Orca
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
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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/cloudberry

Tutte le issue di apache/cloudberry

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.