Re: maintaining a reference to a fetched row

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: maintaining a reference to a fetched row
Дата
Msg-id 20917.1257367427@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: maintaining a reference to a fetched row  (Brian Karlak <zenkat@metaweb.com>)
Список pgsql-performance
Brian Karlak <zenkat@metaweb.com> writes:
> On Nov 4, 2009, at 8:47 AM, Jeff Janes wrote:
>> Why would the index scan take 1 ms two of the times it is done but 5ms
>> the third time?  Isn't it the same index scan each time?  Or does the
>> change in queue.status change the plan?

> The final update is a different query -- just a plain old update by ID:
> UPDATE queue_proc set status = 'proc' where id = %s ;
> This update by ID takes ~2.5ms, which means it's where the framework
> is spending most of its overhead.

Well, if SELECT FROM queue_proc where id = %s takes 1ms and the update
takes 2.5ms, then you've got 1.5ms going into updating the row, which
means it's not going to get a whole lot faster by switching to some
other WHERE condition.  Maybe you should look at cutting back on indexes
and/or triggers attached to this table.

            regards, tom lane

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

Предыдущее
От: Brian Karlak
Дата:
Сообщение: Re: maintaining a reference to a fetched row
Следующее
От: Dave Crooke
Дата:
Сообщение: vacuum'ing toast crumbs, detecting dangling transactions