Skip to content
New issue

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

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

Already on GitHub? # to your account

Locking issue while creating indexes #430

Open
yusufnar opened this issue Oct 28, 2024 · 2 comments
Open

Locking issue while creating indexes #430

yusufnar opened this issue Oct 28, 2024 · 2 comments

Comments

@yusufnar
Copy link

yusufnar commented Oct 28, 2024

We use pg_repack to reorganize some large tables(between 100GB and 1TB). We don't have any locking issues while creating the triggers on the source table and swapping tables at the end. But every index creation on the shadow table causes locking issues. The lock waits start to happen just after the CREATE INDEX command starts on the shadow table. It does not last along the whole creation process. The locking disappears after a while, i.e it happens in the first 30 seconds of index creation, but the index creation takes 10 minutes.

Here is the command we are using:

pg_repack -k -e -h <host_name> -d <db_name> -U <user_name> -t <table_name> -o  <column_list>

We are on pg_repack-1.4.6 and PostgreSQL 13.13.

@za-arthur
Copy link
Collaborator

What do you mean by "shadow table"? Is it log_* table?

@yusufnar
Copy link
Author

I mean the clone of the table that the indexes are built on.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants