Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions src/index/gucs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ pub fn init() {
c"`query_sampling_enable` argument of vchordrq.",
c"`query_sampling_enable` argument of vchordrq.",
&VCHORDRQ_QUERY_SAMPLING_ENABLE,
GucContext::Userset,
GucContext::Suset,
GucFlags::default(),
);
GucRegistry::define_int_guc(
Expand All @@ -179,7 +179,7 @@ pub fn init() {
&VCHORDRQ_QUERY_SAMPLING_MAX_RECORDS,
0,
10000,
GucContext::Userset,
GucContext::Suset,
GucFlags::default(),
);
GucRegistry::define_float_guc(
Expand All @@ -189,7 +189,7 @@ pub fn init() {
&VCHORDRQ_QUERY_SAMPLING_RATE,
0.0,
1.0,
GucContext::Userset,
GucContext::Suset,
GucFlags::default(),
);
unsafe {
Expand Down
16 changes: 8 additions & 8 deletions src/sql/finalize.sql
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ RETURNS TABLE(
index_name NAME,
table_name NAME,
column_name NAME,
operator TEXT,
operator NAME,
value TEXT
)
LANGUAGE plpgsql
Expand All @@ -179,12 +179,7 @@ BEGIN
I.relname AS index_name,
C.relname AS table_name,
PA.attname AS column_name,
CASE
WHEN OP.opcname LIKE '%%l2%%' THEN '<->'
WHEN OP.opcname LIKE '%%ip%%' THEN '<#>'
WHEN OP.opcname LIKE '%%cosine%%' THEN '<=>'
ELSE ''
END AS operator
OP.oprname AS operator
FROM
pg_catalog.pg_index X
JOIN
Expand All @@ -196,11 +191,16 @@ BEGIN
JOIN
pg_catalog.pg_am A ON A.oid = I.relam
LEFT JOIN
pg_catalog.pg_opclass AS OP ON OP.oid = X.indclass[0]
pg_catalog.pg_opclass AS OPC ON OPC.oid = X.indclass[0]
LEFT JOIN
pg_catalog.pg_amop AO ON OPC.opcfamily = AO.amopfamily
LEFT JOIN
pg_catalog.pg_operator OP ON OP.oid = AO.amopopr
LEFT JOIN
pg_catalog.pg_attribute PA ON PA.attrelid = X.indrelid AND PA.attnum = X.indkey[0]
WHERE
A.amname = 'vchordrq'
AND AO.amopstrategy = 1
AND C.relkind = 'r'
AND X.indnatts = 1
AND X.indexrelid = %1$s
Expand Down
2 changes: 1 addition & 1 deletion tests/vchordrq/recall.slt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ FROM (
SELECT
vchordrq_evaluate_query_recall(
query => format(
'SELECT ctid FROM %I.%I ORDER BY %I %s ''%s'' LIMIT 10',
'SELECT ctid FROM %I.%I ORDER BY %I OPERATOR(%s) %L LIMIT 10',
lq.schema_name,
lq.table_name,
lq.column_name,
Expand Down
Loading