[Bug] ORCA: "bogus index qualification" when a filter on an INCLUDE-only index column is pushed into the index qual
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
調査の方向性
SQL の例で失敗を再現し、次に 1249 行付近の nodeIndexscan.c を読み、オプティマイザーを無効にした場合の ORCA EXPLAIN の出力と比較してください。INCLUDE-only-column フィルターによって誤ったインデックス修飾が発生せず、どちらのオプティマイザー設定でもクエリが期待される 2 行を返すようになれば、修正は完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- C
- スター
- 1.4k
- フォーク
- 248
- 平均マージ
- 4日 10時間
- マージ済み PR(30日)
- 40
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/cloudberry のほかの issue
-
type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/cloudberry#1885 · リアクション 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
apache/cloudberry#1825 ·
-
type: Bug
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
apache/cloudberry#2048 · リアクション 1 件 ·
-
type: Bug
難易度 4/5 3〜5日 初心者へのやさしさ 40/100
apache/cloudberry#2047 ·
-
type: Bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
apache/cloudberry#2046 · コメント 1 件 ·
apache/cloudberry の issue をすべて見る
似ている issue
-
task
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vsanthanam/JBird#429 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
bug documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
es-ude/OnDeviceTraining#459 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
bilelmoussaoui/gobject-linter#199 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bradcypert/plum#53 ·