Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PGPRO-11599] Fix wrong results returned when order_by_attach=TRUE.#164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
arseny114 wants to merge10 commits intopostgrespro:master
base:master
Choose a base branch
Loading
fromarseny114:PGPRO-11599_bitmap
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
[PGPRO-11599] Code review. Part 1.
Tags: rum
  • Loading branch information
Arseny Kositsyn committedOct 27, 2025
commitd49bb6e15afd9582f352a94214cf247f7dc0d15c
17 changes: 9 additions & 8 deletionsexpected/altorder.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -575,14 +575,15 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&q:*' AND d >= '2016-05-16 14:21:25' ORDE

CREATE TABLE test_table (id bigint, folder bigint, time bigint, tsv tsvector);
CREATE INDEX test_idx ON test_table USING rum(folder, tsv rum_tsvector_addon_ops, time) with (attach = 'time', to = 'tsv', order_by_attach=TRUE);
INSERT INTO test_table (id, folder, time, tsv) VALUES (1, 10, 100, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (2, 20, 200, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (3, 10, 300, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (4, 20, 400, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (5, 20, 60, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (6, 10, 40, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (7, 20, 50, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (8, 10, 30, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES
(1, 10, 100, to_tsvector('wordA')),
(2, 20, 200, to_tsvector('wordB')),
(3, 10, 300, to_tsvector('wordA')),
(4, 20, 400, to_tsvector('wordB')),
(5, 20, 60, to_tsvector('wordB')),
(6, 10, 40, to_tsvector('wordA')),
(7, 20, 50, to_tsvector('wordB')),
(8, 10, 30, to_tsvector('wordA'));
EXPLAIN (costs off)
SELECT * FROM test_table WHERE tsv @@ (to_tsquery('wordA')) AND (folder = 10::bigint);
QUERY PLAN
Expand Down
17 changes: 9 additions & 8 deletionsexpected/altorder_1.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -575,14 +575,15 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&q:*' AND d >= '2016-05-16 14:21:25' ORDE
CREATE TABLE test_table (id bigint, folder bigint, time bigint, tsv tsvector);
CREATE INDEX test_idx ON test_table USING rum(folder, tsv rum_tsvector_addon_ops, time) with (attach = 'time', to = 'tsv', order_by_attach=TRUE);
ERROR: doesn't support order index over pass-by-reference column
INSERT INTO test_table (id, folder, time, tsv) VALUES (1, 10, 100, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (2, 20, 200, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (3, 10, 300, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (4, 20, 400, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (5, 20, 60, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (6, 10, 40, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (7, 20, 50, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (8, 10, 30, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES
(1, 10, 100, to_tsvector('wordA')),
(2, 20, 200, to_tsvector('wordB')),
(3, 10, 300, to_tsvector('wordA')),
(4, 20, 400, to_tsvector('wordB')),
(5, 20, 60, to_tsvector('wordB')),
(6, 10, 40, to_tsvector('wordA')),
(7, 20, 50, to_tsvector('wordB')),
(8, 10, 30, to_tsvector('wordA'));
EXPLAIN (costs off)
SELECT * FROM test_table WHERE tsv @@ (to_tsquery('wordA')) AND (folder = 10::bigint);
QUERY PLAN
Expand Down
17 changes: 9 additions & 8 deletionsexpected/altorder_2.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -585,14 +585,15 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&q:*' AND d >= '2016-05-16 14:21:25' ORDE
CREATE TABLE test_table (id bigint, folder bigint, time bigint, tsv tsvector);
CREATE INDEX test_idx ON test_table USING rum(folder, tsv rum_tsvector_addon_ops, time) with (attach = 'time', to = 'tsv', order_by_attach=TRUE);
ERROR: doesn't support order index over pass-by-reference column
INSERT INTO test_table (id, folder, time, tsv) VALUES (1, 10, 100, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (2, 20, 200, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (3, 10, 300, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (4, 20, 400, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (5, 20, 60, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (6, 10, 40, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (7, 20, 50, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (8, 10, 30, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES
(1, 10, 100, to_tsvector('wordA')),
(2, 20, 200, to_tsvector('wordB')),
(3, 10, 300, to_tsvector('wordA')),
(4, 20, 400, to_tsvector('wordB')),
(5, 20, 60, to_tsvector('wordB')),
(6, 10, 40, to_tsvector('wordA')),
(7, 20, 50, to_tsvector('wordB')),
(8, 10, 30, to_tsvector('wordA'));
EXPLAIN (costs off)
SELECT * FROM test_table WHERE tsv @@ (to_tsquery('wordA')) AND (folder = 10::bigint);
QUERY PLAN
Expand Down
17 changes: 9 additions & 8 deletionssql/altorder.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,14 +102,15 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&q:*' AND d >= '2016-05-16 14:21:25' ORDE
CREATE TABLE test_table (id bigint, folder bigint, time bigint, tsv tsvector);
CREATE INDEX test_idx ON test_table USING rum(folder, tsv rum_tsvector_addon_ops, time) with (attach = 'time', to = 'tsv', order_by_attach=TRUE);

INSERT INTO test_table (id, folder, time, tsv) VALUES (1, 10, 100, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (2, 20, 200, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (3, 10, 300, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (4, 20, 400, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (5, 20, 60, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (6, 10, 40, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (7, 20, 50, to_tsvector('wordB'));
INSERT INTO test_table (id, folder, time, tsv) VALUES (8, 10, 30, to_tsvector('wordA'));
INSERT INTO test_table (id, folder, time, tsv) VALUES
(1, 10, 100, to_tsvector('wordA')),
(2, 20, 200, to_tsvector('wordB')),
(3, 10, 300, to_tsvector('wordA')),
(4, 20, 400, to_tsvector('wordB')),
(5, 20, 60, to_tsvector('wordB')),
(6, 10, 40, to_tsvector('wordA')),
(7, 20, 50, to_tsvector('wordB')),
(8, 10, 30, to_tsvector('wordA'));

EXPLAIN (costs off)
SELECT * FROM test_table WHERE tsv @@ (to_tsquery('wordA')) AND (folder = 10::bigint);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp