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

[Feature] Allowing autovacuum_enabled to be set during table creation #172

Open
3 tasks done
joshuataylor opened this issue Nov 7, 2024 · 0 comments
Open
3 tasks done
Labels
enhancement New feature or request

Comments

@joshuataylor
Copy link

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt-postgres functionality, rather than a Big Idea better suited to a discussion

Describe the feature

With Postgres, you can use the following to create a table without autovacuum:

CREATE TABLE public.new_table (
    id serial primary key
) WITH (autovacuum_enabled = false);

You can also do it using alter table, for example with a post hook.

Why?

Certain tables don't need autovacuum turned on, and use system resources. Yes, autovacuum is set to low priority, but you still don't want this, sometimes.

For example, tables which are always re-created during a run (staging tables, etc) and can't be incremental, for whatever reason.

We're seeing very long times for vacuums for larger tables we recreate every run.

Describe alternatives you've considered

Post hooks.

Who will this benefit?

Users needing to set autovacuum.

Are you interested in contributing this feature?

yes

Anything else?

I would ideally like this to be generic, so the user can instead select other options when creating a table https://www.postgresql.org/docs/current/sql-createtable.html.

@joshuataylor joshuataylor added enhancement New feature or request triage labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants