Re: Update using primary key slow

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Update using primary key slow
Дата
Msg-id 23322.1130442063@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Update using primary key slow  (Denis <denis.sailer@yellowbook.com>)
Ответы Re: Reasons and drawbacks for unused item pointers (was: Update using primary key slow)
Список pgsql-performance
Denis <denis.sailer@yellowbook.com> writes:
> tgl@sss.pgh.pa.us (Tom Lane) wrote in
> news:19722.1130429883@sss.pgh.pa.us:
>> The 183 msec is the time needed to *fetch* the row, not the time to
>> update it.  So it could well be that the other time is just the time
>> needed to update the table and indexes.  If this seems slower than
>> your hardware ought to be able to handle, I'd wonder about how
>> recently the table has been vacuumed.

> Here is the latest vacuum today.

> INFO:  "contract": removed 64146 row versions in 26115 pages
> DETAIL:  CPU 1.94s/2.55u sec elapsed 7.78 sec.
> INFO:  "contract": found 64146 removable, 5106307 nonremovable row
> versions in 129154 pages
> DETAIL:  890 dead row versions cannot be removed yet.
> There were 1905028 unused item pointers.

The "unused item pointers" number seems a bit high, but otherwise that
looks pretty reasonable.

Is it possible that the particular row you were updating has been
updated quite a lot of times since the last vacuum?  Or even quite
a few times within a single transaction?  The only thing I can think
of that would explain such a slow fetch is if the code has to reject
a bunch of recently-dead versions of the row.

            regards, tom lane

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

Предыдущее
От: "PostgreSQL"
Дата:
Сообщение: How much memory?
Следующее
От: "PostgreSQL"
Дата:
Сообщение: Re: What gets cached?