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

Commit0ed7445

Browse files
committed
Allow spgist's text_ops to handle pattern-matching operators.
This was presumably intended to work this way all along, but a few keybits of indxpath.c didn't get the memo.Robert Haas and Tom Lane
1 parentb4e0741 commit0ed7445

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

‎src/backend/optimizer/path/indxpath.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2847,7 +2847,7 @@ match_special_index_operator(Expr *clause, Oid opfamily, Oid idxcollation,
28472847
/*
28482848
* Must also check that index's opfamily supports the operators we will
28492849
* want to apply. (A hash index, for example, will not support ">=".)
2850-
* Currently, only btreesupports the operators we need.
2850+
* Currently, only btreeand spgist support the operators we need.
28512851
*
28522852
* Note: actually, in the Pattern_Prefix_Exact case, we only need "=" so a
28532853
* hash index would work. Currently it doesn't seem worth checking for
@@ -2871,6 +2871,7 @@ match_special_index_operator(Expr *clause, Oid opfamily, Oid idxcollation,
28712871
caseOID_TEXT_ICREGEXEQ_OP:
28722872
isIndexable=
28732873
(opfamily==TEXT_PATTERN_BTREE_FAM_OID)||
2874+
(opfamily==TEXT_SPGIST_FAM_OID)||
28742875
(opfamily==TEXT_BTREE_FAM_OID&&
28752876
(pstatus==Pattern_Prefix_Exact||
28762877
lc_collate_is_c(idxcollation)));
@@ -3454,6 +3455,7 @@ prefix_quals(Node *leftop, Oid opfamily, Oid collation,
34543455
{
34553456
caseTEXT_BTREE_FAM_OID:
34563457
caseTEXT_PATTERN_BTREE_FAM_OID:
3458+
caseTEXT_SPGIST_FAM_OID:
34573459
datatype=TEXTOID;
34583460
break;
34593461

‎src/include/catalog/pg_opfamily.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,6 @@ DATA(insert OID = 3919 (783range_opsPGNSP PGUID ));
145145
DATA(insertOID=4015 (4000quad_point_opsPGNSPPGUID ));
146146
DATA(insertOID=4016 (4000kd_point_opsPGNSPPGUID ));
147147
DATA(insertOID=4017 (4000text_opsPGNSPPGUID ));
148+
#defineTEXT_SPGIST_FAM_OID 4017
148149

149150
#endif/* PG_OPFAMILY_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp