Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,948 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, postgresql, sql
領域
databases

調査の方向性

SQL の例で失敗を再現し、次に 1249 行付近の nodeIndexscan.c を読み、オプティマイザーを無効にした場合の ORCA EXPLAIN の出力と比較してください。INCLUDE-only-column フィルターによって誤ったインデックス修飾が発生せず、どちらのオプティマイザー設定でもクエリが期待される 2 行を返すようになれば、修正は完了です。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
C
スター
1.4k
フォーク
248
平均マージ
4日 10時間
マージ済み PR(30日)
40

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/cloudberry のほかの issue

apache/cloudberry の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。