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
7 changes: 4 additions & 3 deletions src/index/vchordrq/am/am_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,10 @@ mod vchordrq_cached {
}
let pages_s = buffer.len();
buffer.extend(pages.iter().flat_map(|x| unsafe {
std::mem::transmute::<&PostgresPage<vchordrq::Opaque>, &[u8; 8192]>(
x.as_ref(),
)
std::mem::transmute::<
&PostgresPage<vchordrq::Opaque>,
&[u8; pgrx::pg_sys::BLCKSZ as usize],
>(x.as_ref())
}));
let pages_e = buffer.len();
while buffer.len() % ALIGN != 0 {
Expand Down
6 changes: 3 additions & 3 deletions src/index/vchordrq/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ pub fn maintain<R>(
check,
),
};
pgrx::info!(
pgrx::debug1!(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everywhere else in postgres or common extensions, CREATE EXTENSION does not produce any logs in the common success case. This change brings vchord to par with this expectation.

It is annoying when I am directly running commands in psql and unnecessary output logs move more important commands and outputs out of my terminal view.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everywhere else in postgres or common extensions, CREATE EXTENSION does not produce any logs in the common success case.

Do you mean CREATE INDEX? VectorChord should not print logs in CREATE EXTENSION.

This change brings vchord to par with this expectation.

We consider this a feature, so it would be inappropriate to hide it directly.

It is annoying when I am directly running commands in psql and unnecessary output logs move more important commands and outputs out of my terminal view.

You can change all pgrx::info in the code to pgrx::notice. Then, use SET client_min_messages = warning to hide these messages.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that you're not hiding the logs of clustering. I think this change is reasonable, although I don't understand why you ignore the 10+ lines of clustering-related logs above and only focus on the 3 lines at the bottom.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, those had not triggered in my test run. now I see what you mean. happy to turn those into debug1 as well if that works for you!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy to turn those into debug1 as well if that works for you!

Keep it as it is.

"maintain: number_of_formerly_allocated_pages = {}",
maintain.number_of_formerly_allocated_pages
);
pgrx::info!(
pgrx::debug1!(
"maintain: number_of_freshly_allocated_pages = {}",
maintain.number_of_freshly_allocated_pages
);
pgrx::info!(
pgrx::debug1!(
"maintain: number_of_freed_pages = {}",
maintain.number_of_freed_pages
);
Expand Down
8 changes: 4 additions & 4 deletions src/sql/finalize.sql
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,16 @@ CREATE OPERATOR @# (
-- List of functions

CREATE FUNCTION sphere(vector, real) RETURNS sphere_vector
IMMUTABLE PARALLEL SAFE LANGUAGE sql AS 'SELECT ROW($1, $2)';
IMMUTABLE PARALLEL SAFE LANGUAGE sql AS 'SELECT ROW($1, $2)::sphere_vector';

CREATE FUNCTION sphere(halfvec, real) RETURNS sphere_halfvec
IMMUTABLE PARALLEL SAFE LANGUAGE sql AS 'SELECT ROW($1, $2)';
IMMUTABLE PARALLEL SAFE LANGUAGE sql AS 'SELECT ROW($1, $2)::sphere_halfvec';

CREATE FUNCTION sphere(rabitq8, real) RETURNS sphere_rabitq8
IMMUTABLE PARALLEL SAFE LANGUAGE sql AS 'SELECT ROW($1, $2)';
IMMUTABLE PARALLEL SAFE LANGUAGE sql AS 'SELECT ROW($1, $2)::sphere_rabitq8';

CREATE FUNCTION sphere(rabitq4, real) RETURNS sphere_rabitq4
IMMUTABLE PARALLEL SAFE LANGUAGE sql AS 'SELECT ROW($1, $2)';
IMMUTABLE PARALLEL SAFE LANGUAGE sql AS 'SELECT ROW($1, $2)::sphere_rabitq4';

CREATE FUNCTION quantize_to_rabitq8(vector) RETURNS rabitq8
IMMUTABLE STRICT PARALLEL SAFE LANGUAGE c AS 'MODULE_PATHNAME', '_vchord_vector_quantize_to_rabitq8_wrapper';
Expand Down
Loading