[Bug] GPORCA: ERROR "btree index keys must be ordered by attribute" when a qual references an INCLUDE column
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Start by reproducing the SQL examples with GPORCA enabled, then compare the plans and results with the optimizer disabled. Trace how the btree INCLUDE column reaches the Index Cond; done means INCLUDE columns are not used as scan keys and the queries complete without the runtime error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Apache Cloudberry version
No response
What happened
With GPORCA (optimizer = on), a qual on a btree index's INCLUDE (non-key) column can be pushed into the Index Cond. INCLUDE columns are payload only and are not searchable, so the executor
rejects the scan keys at runtime:
ERROR: btree index keys must be ordered by attribute (nbtutils.c:799)
The Postgres planner (optimizer = off) is not affected. The table does not need to contain any rows.
What you think should happen instead
No response
How to reproduce
CREATE TABLE c2t(a int, b int) DISTRIBUTED BY (a);
CREATE INDEX ci1 ON c2t USING btree (a) INCLUDE (b);
SET optimizer = on;
SELECT a, b FROM c2t WHERE b IS NULL;
-- ERROR: btree index keys must be ordered by attribute (nbtutils.c:799) (seg2 slice1 ...)
The plan puts the INCLUDE column b into the Index Cond:
EXPLAIN (COSTS OFF) SELECT a, b FROM c2t WHERE b IS NULL;
Gather Motion 3:1 (slice1; segments: 3)
-> Index Scan using ci1 on c2t
Index Cond: (b IS NULL)
Optimizer: GPORCA
Same error with GROUP BY and with an index whose INCLUDE list repeats a key column:
CREATE TABLE c1t(a int, b int) DISTRIBUTED BY (a);
CREATE INDEX ci0 ON c1t USING btree (a) INCLUDE (a, b);
SET optimizer = on;
SELECT a, b FROM c1t WHERE b IS NULL GROUP BY a, b;
-- ERROR: btree index keys must be ordered by attribute (nbtutils.c:799)
With SET optimizer = off; all of the above return the correct rows.
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.
- Ngôn ngữ chính
- C
- Star
- 1.4k
- Fork
- 260
- Merge trung bình
- 4 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 56
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/cloudberry
-
[Bug] Expand fails to recognize user-defined tablespacesCó thể đã có người làm @nix-oss đã nhận 58 ngày trước. Đang mởtype: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/cloudberry#1885 · 2 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
-
gpexpand first stage fails: 'SyncPackages' object has no attribute 'ret' (extension sync never runs; regression)Có thể đã có người làm @talmacschen-arch đã nhận 119 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
apache/cloudberry#1825 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
type: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
apache/cloudberry#2135 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug] REINDEX DATABASE CONCURRENTLY breaks temporary PAX tables created with ON COMMIT DELETE ROWSĐang mởtype: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
apache/cloudberry#2134 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
apache/cloudberry#2130 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của apache/cloudberry
Issue tương tự
-
[Issue]: hipsparselt.h C API as shipped now requires C23 -- ONLY because of missing include or guardĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ROCm/rocm-libraries#13736 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`inverse()` of a controlled `CUGate` drops the phase parameter γCó thể đã có người làm @rupasri118 đã nhận hôm nay. Đang mởbug mod: circuit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Qiskit/qiskit#17223 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
PackageKit/PackageKit#1026 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OpenPrinting/libcupsfilters#284 ·
Maintainer thường phản hồi trong vòng 1 ngày