B
B
beduin012021-07-29 09:34:47
PostgreSQL
beduin01, 2021-07-29 09:34:47

How to optimize the execution of heavy queries?

It is not the query correction itself and its refinement that is of interest, but the situation when you need to collect some statistics from the database and at the same time make sure that the system does not slow down too much.
Is it possible to make the query run longer, but use less CPU - maybe there are some ways to lower the priority of execution?

Are there any built-in cached mechanisms that can be said to request X to return data from the cache when calling it more than N minutes/hours?

CPU 6 cores.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Melkij, 2021-07-29
@melkij

Is it possible to make the query run longer, but use less CPU - maybe there are some ways to lower the priority of execution?

Normal nice. Process model, no problem to lower the priority of a particular process by means of the OS itself.
Are there built-in cached mechanisms that can be said to request X to return data from the cache when calling it more than N minutes/hours?

No, there is no query cache. And it won't.
a situation when you need to collect some statistics from the database and at the same time make sure that the system does not slow down too much

Don't mix OLAP and OLTP at all. If the base is important, then it will have a hot standby. There statistics and count.

T
tormozillo, 2021-07-29
@tormozillo

Study parameters max_parallel_workers, max_parallel_workers_per_gather The
CPU isn't single-core, is it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question