Postgres (Cloudsql) shows lock wait on write transactions during an index creation (on unrelated table)
0
votes
0
answers
35
views
Redirected from stackoverflow .
I am using Postgresql on CloudSQL (GCP), in version 15. (Running on 4vCPU, 16Gb RAM, with SSD disk, currently at 500Gb)
We are observing an unexpected issue during index creation. While creating an index on a large-ish table (~10M rows), we observe a spike of lock wait on write transactions (not on read) on completely unrelated tables. By "unrelated", I mean that this happens even if the index is created on a table in a different database (same instance) than the tables where lock wait is observed on writes - so presumably they share only low-level postgres ressources as well as the infrastructure ressources.
Essentially I am interested in knowing if this happened to others, and in which conditions. Initially we thought that "lock wait" in the query analytics interface was reported only for transaction locks, but this issue seems to indicate that it also includes wait time for IO ressources. I would be happy if anyone can confirm or point me to a better hypothesis.
Asked by Pascal Delange
(101 rep)
May 17, 2025, 09:10 PM