Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[columnar] fixes edge case for vacuum udf and adds vacuum_full udf #93

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

JerrySievert
Copy link
Contributor

Two Parts

  1. Fixes an edge case on the vacuum UDF where the state of holes can get weird, instead of calculating, just retrieve the state as needed after a change. This is less performant, but more correct.
  2. Adds columnar.vacuum_full() UDF that allows for the full vacuum of a schema of columnar tables as a convenience function.

columnar.vacuum_full(schema, sleep_time, stripe_count)

This is a convenience function that allows for a full incremental vacuum to be called to vacuum a full schema incrementally, table by table.

Argument Type Description Default
schema name Schema to vacuum, will query for any tables public
sleep_time real Amount of time to wait between each call of the columnar.vacuum UDF in seconds (uses pg_sleep) 0.1
stripe_count int Number of stripes to attempt to vacuum between pg_sleep calls 25

Usage

SELECT columnar.vacuum_full();
SELECT columnar.vacuum_full('public', 0.1, 25);
SELECT columnar.vacuum_full(sleep_time => 1.5);

@JerrySievert JerrySievert requested review from wuputah and mkaruza June 14, 2023 00:05
@JerrySievert JerrySievert self-assigned this Jun 14, 2023
Copy link
Member

@wuputah wuputah left a comment

Choose a reason for hiding this comment

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

most impressive

@JerrySievert JerrySievert merged commit 1eb2219 into main Jun 14, 2023
@JerrySievert JerrySievert deleted the vacuum_full branch June 14, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants