8000 Fix when we VACUUM ANALYZE. by dimitri · Pull Request #228 · dimitri/pgcopydb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix when we VACUUM ANALYZE. #228

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

Merged
merged 1 commit into from
Apr 3, 2023
Merged

Fix when we VACUUM ANALYZE. #228

merged 1 commit into from
Apr 3, 2023

Conversation

dimitri
Copy link
Owner
@dimitri dimitri commented Apr 3, 2023

Careful reading of the Explicit Locking chapter of Postgres documentation shows that VACUUM and ANALYZE take a SHARE UPDATE EXCLUSIVE lock against the target table, and CREATE INDEX take a SHARE lock, which conflicts with the former one.

https://www.postgresql.org/docs/current/explicit-locking.html

So we can't actually VACUUM ANALYZE a table while building the indexes and then constraints on top of that. The queueing of the VACUUM operations is now done after the indexes and constraints are built.

Careful reading of the Explicit Locking chapter of Postgres documentation
shows that VACUUM and ANALYZE take a SHARE UPDATE EXCLUSIVE lock against the
target table, and CREATE INDEX take a SHARE lock, which conflicts with the
former one.

  https://www.postgresql.org/docs/current/explicit-locking.html

So we can't actually VACUUM ANALYZE a table while building the indexes and
then constraints on top of that. The queueing of the VACUUM operations is
now done after the indexes and constraints are built.
@dimitri dimitri merged commit d3f2fbb into main Apr 3, 2023
@dimitri dimitri deleted the fix/vacuum-after-create-index branch April 3, 2023 12:02
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.

1 participant
0