File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ pub fn init() {
169169 c"`query_sampling_enable` argument of vchordrq." ,
170170 c"`query_sampling_enable` argument of vchordrq." ,
171171 & VCHORDRQ_QUERY_SAMPLING_ENABLE ,
172- GucContext :: Userset ,
172+ GucContext :: Suset ,
173173 GucFlags :: default ( ) ,
174174 ) ;
175175 GucRegistry :: define_int_guc (
@@ -179,7 +179,7 @@ pub fn init() {
179179 & VCHORDRQ_QUERY_SAMPLING_MAX_RECORDS ,
180180 0 ,
181181 10000 ,
182- GucContext :: Userset ,
182+ GucContext :: Suset ,
183183 GucFlags :: default ( ) ,
184184 ) ;
185185 GucRegistry :: define_float_guc (
@@ -189,7 +189,7 @@ pub fn init() {
189189 & VCHORDRQ_QUERY_SAMPLING_RATE ,
190190 0.0 ,
191191 1.0 ,
192- GucContext :: Userset ,
192+ GucContext :: Suset ,
193193 GucFlags :: default ( ) ,
194194 ) ;
195195 unsafe {
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ RETURNS TABLE(
152152 index_name NAME,
153153 table_name NAME,
154154 column_name NAME,
155- operator TEXT ,
155+ operator NAME ,
156156 value TEXT
157157)
158158LANGUAGE plpgsql
@@ -179,12 +179,7 @@ BEGIN
179179 I .relname AS index_name,
180180 C .relname AS table_name,
181181 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
188183 FROM
189184 pg_catalog .pg_index X
190185 JOIN
@@ -196,11 +191,16 @@ BEGIN
196191 JOIN
197192 pg_catalog .pg_am A ON A .oid = I .relam
198193 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
200199 LEFT JOIN
201200 pg_catalog .pg_attribute PA ON PA .attrelid = X .indrelid AND PA .attnum = X .indkey [0 ]
202201 WHERE
203202 A .amname = ' vchordrq'
203+ AND AO .amopstrategy = 1
204204 AND C .relkind = ' r'
205205 AND X .indnatts = 1
206206 AND X .indexrelid = %1 $s
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ FROM (
114114 SELECT
115115 vchordrq_evaluate_query_recall(
116116 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',
118118 lq.schema_name,
119119 lq.table_name,
120120 lq.column_name,
You can’t perform that action at this time.
0 commit comments