D
D
Dannerty2019-09-12 12:31:14
PostgreSQL
Dannerty, 2019-09-12 12:31:14

How to fix query slowdown in PostgreSQL?

Hi all.
Actually such a question arose.
How can I fix, or what can I do, so that there is no slowdown in database queries if any heavy SELECT is being performed at this time, or an index is being created (CREATE INDEX CONCURRENTLY), or another DDL operation on a large table?
I have a database - 100 GB.
There are applications that make many requests to the database and the response time is important to them.
When executing a heavy request, all requests from services start to run many times slower (slowdown by 10-30 times, very critical). Moreover, service requests are not related in any way to the tables that participate in the request.
Also, when you create an index without a lock or another DDL operation on the table, it starts to slow down. Here also the table is not used by services.
Whether it is possible to bypass it somehow? You can still solve the issue with requests, but what to do with DDL? Does PostgreSQL have a MySQL equivalent of Percona's 'pt-online-schema'?
Server:
8 cores, 16 GB, SSD, Postgresql 11.3
Postgresql.conf:
shared_buffers - 6GB
effective_cache_size - 10GB
maintenance_work_mem - 1GB
work_mem - 48 MB

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2019-09-12
@ky0

To issue read-only queries on a replica, put under the SSD base (or under the most actively used tables using tablespaces) - there are many options.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question