Re: App very unresponsive while performing simple update

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: App very unresponsive while performing simple update
Дата
Msg-id 20060531062307.GG53487@pervasive.com
обсуждение исходный текст
Ответ на Re: App very unresponsive while performing simple update  (Greg Stark <gsstark@mit.edu>)
Ответы Re: App very unresponsive while performing simple update  (Brendan Duddridge <brendan@clickspace.com>)
Re: App very unresponsive while performing simple update  (Bruno Wolff III <bruno@wolff.to>)
Re: App very unresponsive while performing simple update  (Greg Stark <gsstark@mit.edu>)
Список pgsql-performance
On Sun, May 28, 2006 at 07:20:59PM -0400, Greg Stark wrote:
> Brendan Duddridge <brendan@clickspace.com> writes:
>
> > We do have foreign keys on other tables that reference the product  table.
> > Also, there will be updates going on at the same time as this  update. When
> > anyone clicks on a product details link, we issue an  update statement to
> > increment the click_count on the product. e.g.  update product set click_count
> > = click_count + 1;
>
> You should realize this will produce a lot of garbage records and mean you'll
> have to be running vacuum very frequently. You might consider instead of
> updating the main table inserting into a separate clickstream table. That
> trades off not getting instantaneous live totals with isolating the
> maintenance headache in a single place. That table will grow large but you can
> prune it at your leisure without impacting query performance on your main
> tables.

Actually, you can still get instant results, you just have to hit two
tables to do it.

> More likely you were blocking on some lock. Until that other query holding
> that lock tries to commit Postgres won't actually detect a deadlock, it'll
> just sit waiting until the lock becomes available.

Wow, are you sure that's how it works? I would think it would be able to
detect deadlocks as soon as both processes are waiting on each other's
locks.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Why the 8.1 plan is worst than 7.4?
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: INSERT OU UPDATE WITHOUT SELECT?