Re: Slow table update

Поиск
Список
Период
Сортировка
От Gregory Williamson
Тема Re: Slow table update
Дата
Msg-id 8B319E5A30FF4A48BE7EEAAF609DB233021F389A@COMAIL01.digitalglobe.com
обсуждение исходный текст
Ответ на Slow table update  (Laszlo Nagy <gandalf@shopzeus.com>)
Ответы Re: Slow table update  (Laszlo Nagy <gandalf@shopzeus.com>)
Re: Slow table update  (Laszlo Nagy <gandalf@shopzeus.com>)
Список pgsql-performance

Laszlo Nagy wrote:

>
> Laszlo Nagy wrote:
> > SQL:
> >
> > update product set sz_category_id=null where am_style_kw1 is not null
> > and sz_category_id is not null
> Hmm, this query:
>
> ?select count(*) from product where am_style_kw1 is not null and
> sz_category_id is not null and sz_category_id<>4809
>
> opens in 10 seconds. The update would not finish in 2600 seconds. I
> don't understand.

If the table has some sort of FK relations it might be being slowed by the need to check a row meant to be deleted has any children.

Perhaps triggers ?

If the table is very bloated with lots of dead rows (but you did say you vacuum frequently and check the results to make sure they are effective?) that would slow it down.

A long running transaction elsewhere that is blocking the delete ? Did you check the locks ?

HTH,

Greg Williamson
Senior DBA
DigitalGlobe

Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information and must be protected in accordance with those provisions. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

(My corporate masters made me say this.)


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

Предыдущее
От: Laszlo Nagy
Дата:
Сообщение: Re: Slow table update
Следующее
От: Laszlo Nagy
Дата:
Сообщение: Re: Slow table update