This allows us to carefully control the time the queries may be queued. Instead of relying on Postgres to lock an object when executing a DDL statement, we acquire the lock explicitly ourselves. PostgreSQL offers some additional runtime configuration options that allow us to guarantee query queueing backpressure doesn’t result in downtime. Or maybe you have a few special case queries that you already know will take a long time. Because arbitrarily long queueing of incoming queries is indistinguishable from an outage, we try to avoid any long-running queries in databases supporting our payments processing applications.īut sometimes a query takes longer than you expect. In practice your DDL operations can cause other queries to back up for as long as your longest running query takes to execute. Attempting to acquire this lock causes all subsequent queries on this table to queue until the lock is released. PostgreSQL attempts to acquire an ACCESS EXCLUSIVE lock on the table foos. Note: “Concurrent DDL” for these purposes includes VACUUM and ANALYZE operations.Īll DDL operations generally necessitate acquiring one of these locks on the object being manipulated.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |