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-11480] Fix RUM tsquery evaluation with negated subtrees#153

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
LimarDeWills wants to merge1 commit intopostgrespro:master
base:master
Choose a base branch
Loading
fromLimarDeWills:PGPRO-11480-fix-rum-tsquery-negation
Open
Show file tree
Hide file tree
Changes fromall commits
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
36 changes: 23 additions & 13 deletionsexpected/ruminv.out
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ INSERT INTO test_invrum VALUES ('(a|b)&c'::tsquery);
INSERT INTO test_invrum VALUES ('(!(a|b))&c'::tsquery);
INSERT INTO test_invrum VALUES ('(a|b)&(c|d)'::tsquery);
INSERT INTO test_invrum VALUES ('!a'::tsquery);
INSERT INTO test_invrum VALUES ('a&!(b&c)'::tsquery);
INSERT INTO test_invrum VALUES ('(a|a1|a2|a3|a4|a5)&(b|b1|b2|b3|b4|b5|b6)&!(c|c1|c2|c3)'::tsquery);
SELECT * FROM test_invrum WHERE q @@ ''::tsvector;
q
Expand All@@ -20,12 +21,13 @@ SELECT * FROM test_invrum WHERE q @@ ''::tsvector;
(4 rows)

SELECT * FROM test_invrum WHERE q @@ 'a'::tsvector;
q
----------------
q
----------------------
'a' | 'b'
!( 'a' & 'b' )
'a' & !'b'
(3 rows)
'a' & !( 'b' & 'c' )
(4 rows)

SELECT * FROM test_invrum WHERE q @@ 'b'::tsvector;
q
Expand All@@ -42,8 +44,9 @@ SELECT * FROM test_invrum WHERE q @@ 'a b'::tsvector;
'a' | 'b'
'a' & 'b'
!'a' | 'b'
'a' & !( 'b' & 'c' )
( 'a' | 'a1' | 'a2' | 'a3' | 'a4' | 'a5' ) & ( 'b' | 'b1' | 'b2' | 'b3' | 'b4' | 'b5' | 'b6' ) & !( 'c' | 'c1' | 'c2' | 'c3' )
(4 rows)
(5 rows)

SELECT * FROM test_invrum WHERE q @@ 'c'::tsvector;
q
Expand All@@ -63,7 +66,8 @@ SELECT * FROM test_invrum WHERE q @@ 'a c'::tsvector;
'a' & !'b'
( 'a' | 'b' ) & 'c'
( 'a' | 'b' ) & ( 'c' | 'd' )
(5 rows)
'a' & !( 'b' & 'c' )
(6 rows)

SELECT * FROM test_invrum WHERE q @@ 'b c'::tsvector;
q
Expand DownExpand Up@@ -102,7 +106,8 @@ SELECT * FROM test_invrum WHERE q @@ 'a d'::tsvector;
!( 'a' & 'b' )
'a' & !'b'
( 'a' | 'b' ) & ( 'c' | 'd' )
(4 rows)
'a' & !( 'b' & 'c' )
(5 rows)

SELECT * FROM test_invrum WHERE q @@ 'b d'::tsvector;
q
Expand All@@ -121,8 +126,9 @@ SELECT * FROM test_invrum WHERE q @@ 'a b d'::tsvector;
'a' & 'b'
!'a' | 'b'
( 'a' | 'b' ) & ( 'c' | 'd' )
'a' & !( 'b' & 'c' )
( 'a' | 'a1' | 'a2' | 'a3' | 'a4' | 'a5' ) & ( 'b' | 'b1' | 'b2' | 'b3' | 'b4' | 'b5' | 'b6' ) & !( 'c' | 'c1' | 'c2' | 'c3' )
(5 rows)
(6 rows)

SELECT * FROM test_invrum WHERE q @@ 'c d'::tsvector;
q
Expand All@@ -142,7 +148,8 @@ SELECT * FROM test_invrum WHERE q @@ 'a c d'::tsvector;
'a' & !'b'
( 'a' | 'b' ) & 'c'
( 'a' | 'b' ) & ( 'c' | 'd' )
(5 rows)
'a' & !( 'b' & 'c' )
(6 rows)

CREATE INDEX test_invrum_idx ON test_invrum USING rum(q);
SET enable_seqscan = OFF;
Expand All@@ -152,12 +159,13 @@ SELECT * FROM test_invrum WHERE q @@ ''::tsvector;
(0 rows)

SELECT * FROM test_invrum WHERE q @@ 'a'::tsvector;
q
----------------
q
----------------------
'a' | 'b'
!( 'a' & 'b' )
'a' & !'b'
(3 rows)
'a' & !( 'b' & 'c' )
(4 rows)

SELECT * FROM test_invrum WHERE q @@ 'b'::tsvector;
q
Expand DownExpand Up@@ -216,7 +224,8 @@ SELECT * FROM test_invrum WHERE q @@ 'a b c'::tsvector;
!'a' | 'b'
( 'a' | 'b' ) & 'c'
( 'a' | 'b' ) & ( 'c' | 'd' )
(5 rows)
'a' & !( 'b' & 'c' )
(6 rows)

SELECT * FROM test_invrum WHERE q @@ 'd'::tsvector;
q
Expand All@@ -234,7 +243,8 @@ SELECT * FROM test_invrum WHERE q @@ 'a d'::tsvector;
!( 'a' & 'b' )
'a' & !'b'
( 'a' | 'b' ) & ( 'c' | 'd' )
(4 rows)
'a' & !( 'b' & 'c' )
(5 rows)

SELECT * FROM test_invrum WHERE q @@ 'b d'::tsvector;
q
Expand Down
1 change: 1 addition & 0 deletionssql/ruminv.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ INSERT INTO test_invrum VALUES ('(a|b)&c'::tsquery);
INSERT INTO test_invrum VALUES ('(!(a|b))&c'::tsquery);
INSERT INTO test_invrum VALUES ('(a|b)&(c|d)'::tsquery);
INSERT INTO test_invrum VALUES ('!a'::tsquery);
INSERT INTO test_invrum VALUES ('a&!(b&c)'::tsquery);
INSERT INTO test_invrum VALUES ('(a|a1|a2|a3|a4|a5)&(b|b1|b2|b3|b4|b5|b6)&!(c|c1|c2|c3)'::tsquery);

SELECT * FROM test_invrum WHERE q @@ ''::tsvector;
Expand Down
1 change: 1 addition & 0 deletionssrc/rumtsquery.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -94,6 +94,7 @@ make_query_item_wrap(QueryItem *item, QueryItemWrap *parent, bool not)

wrap->type = QI_OPR;
wrap->oper = oper;
wrap->not = not;

make_query_item_wrap(item + item->qoperator.left, wrap, not);
make_query_item_wrap(item + 1, wrap, not);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp