File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ pub fn init() {
169
169
c"`query_sampling_enable` argument of vchordrq." ,
170
170
c"`query_sampling_enable` argument of vchordrq." ,
171
171
& VCHORDRQ_QUERY_SAMPLING_ENABLE ,
172
- GucContext :: Userset ,
172
+ GucContext :: Suset ,
173
173
GucFlags :: default ( ) ,
174
174
) ;
175
175
GucRegistry :: define_int_guc (
@@ -179,7 +179,7 @@ pub fn init() {
179
179
& VCHORDRQ_QUERY_SAMPLING_MAX_RECORDS ,
180
180
0 ,
181
181
10000 ,
182
- GucContext :: Userset ,
182
+ GucContext :: Suset ,
183
183
GucFlags :: default ( ) ,
184
184
) ;
185
185
GucRegistry :: define_float_guc (
@@ -189,7 +189,7 @@ pub fn init() {
189
189
& VCHORDRQ_QUERY_SAMPLING_RATE ,
190
190
0.0 ,
191
191
1.0 ,
192
- GucContext :: Userset ,
192
+ GucContext :: Suset ,
193
193
GucFlags :: default ( ) ,
194
194
) ;
195
195
unsafe {
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ RETURNS TABLE(
152
152
index_name NAME,
153
153
table_name NAME,
154
154
column_name NAME,
155
- operator TEXT ,
155
+ operator NAME ,
156
156
value TEXT
157
157
)
158
158
LANGUAGE plpgsql
@@ -179,12 +179,7 @@ BEGIN
179
179
I .relname AS index_name,
180
180
C .relname AS table_name,
181
181
PA .attname AS column_name,
182
- CASE
183
- WHEN OP .opcname LIKE ' %%l2%%' THEN ' <->'
184
- WHEN OP .opcname LIKE ' %%ip%%' THEN ' <#>'
185
- WHEN OP .opcname LIKE ' %%cosine%%' THEN ' <=>'
186
- ELSE ' '
187
- END AS operator
182
+ OP .oprname AS operator
188
183
FROM
189
184
pg_catalog .pg_index X
190
185
JOIN
@@ -196,11 +191,16 @@ BEGIN
196
191
JOIN
197
192
pg_catalog .pg_am A ON A .oid = I .relam
198
193
LEFT JOIN
199
- pg_catalog .pg_opclass AS OP ON OP .oid = X .indclass [0 ]
194
+ pg_catalog .pg_opclass AS OPC ON OPC .oid = X .indclass [0 ]
195
+ LEFT JOIN
196
+ pg_catalog .pg_amop AO ON OPC .opcfamily = AO .amopfamily
197
+ LEFT JOIN
198
+ pg_catalog .pg_operator OP ON OP .oid = AO .amopopr
200
199
LEFT JOIN
201
200
pg_catalog .pg_attribute PA ON PA .attrelid = X .indrelid AND PA .attnum = X .indkey [0 ]
202
201
WHERE
203
202
A .amname = ' vchordrq'
203
+ AND AO .amopstrategy = 1
204
204
AND C .relkind = ' r'
205
205
AND X .indnatts = 1
206
206
AND X .indexrelid = %1 $s
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ FROM (
114
114
SELECT
115
115
vchordrq_evaluate_query_recall(
116
116
query => format(
117
- 'SELECT ctid FROM %I.%I ORDER BY %I %s ''%s'' LIMIT 10',
117
+ 'SELECT ctid FROM %I.%I ORDER BY %I OPERATOR(%s) %L LIMIT 10',
118
118
lq.schema_name,
119
119
lq.table_name,
120
120
lq.column_name,
You can’t perform that action at this time.
0 commit comments