Re: How to improve the performance of my SQL query?

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: How to improve the performance of my SQL query?
Дата
Msg-id CAApHDvq08k_iJb8sCCAVPdV8A9JL0hEWFvs=3ryYsx3dApVOQQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to improve the performance of my SQL query?  (gzh <gzhcoder@126.com>)
Ответы Re: How to improve the performance of my SQL query?  (gzh <gzhcoder@126.com>)
Список pgsql-general
On Wed, 26 Jul 2023 at 19:46, gzh <gzhcoder@126.com> wrote:
> QUERY PLAN (enable_seqscan=on)

> Execution Time: 167183.133 ms

> QUERY PLAN (enable_seqscan=off)

> Execution Time: 22320.153 ms

effective_cache_size and random_page_cost are the settings you should
be adjusting to coax the planner into using the index.

A rule of thumb for effective_cache_size would be to set it to about
75% of RAM. There are certainly cases where lower would make more
sense, certainly, 75% will make more sense than the default 4GB value
in the majority of cases.

For random_page_cost, the default of 4.0 has been the default since
HDDs were common. SSDs are common now and, comparatively to sequential
I/O, their random I/O is faster than that of an HDD, so you may get
better results by lowering random_page_cost.

David



В списке pgsql-general по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Difference in the tablespace folders on primary and secondary nodes
Следующее
От: kg.postgresql@olympiakos.com
Дата:
Сообщение: Bogus temp file reporting?