Re: Disk wait problem... may not be hardware...

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Disk wait problem... may not be hardware...
Дата
Msg-id 20231029150046.zkoicc6g4247mzwm@hjp.at
обсуждение исходный текст
Ответ на Re: Disk wait problem... may not be hardware...  (pf@pfortin.com)
Ответы Re: Disk wait problem... may not be hardware...
Список pgsql-general
On 2023-10-27 19:46:09 -0400, pf@pfortin.com wrote:
> On Fri, 27 Oct 2023 19:07:11 +0200 Peter J. Holzer wrote:
> >Have you looked at the query plans as I recommended? (You might also
> >want to enable track_io_timing to get extra information, but comparing
> >just the query plans of fast and slow queries would be a first step)
>
> I didn't see how that would help since other than the table name the
> queries are identical.  Curious: are you implying PG stores tables
> differently?

No, but Postgres decides on the query depending on the statistics stored
about that table. If those statistics are off, the query plan can be
wildly different and very inefficient. So checking whether the plans are
plausible should be one of the first things you do when performance is
not what you expect. Indeed, on
https://wiki.postgresql.org/wiki/Slow_Query_Questions it is the very
first bullet point in the section "Things to Try Before You Post".

When you have established that the plan looks fine even when the
performance is poor then you have to look elsewhere. But even then it
helps to know what the database is actually trying to do.

        hp



--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

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

Предыдущее
От: pf@pfortin.com
Дата:
Сообщение: [SOLVED?] Re: Disk wait problem... not hardware...
Следующее
От: Paul Förster
Дата:
Сообщение: Re: pg_checksums?