Re: Poor performance of delete by primary key

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Poor performance of delete by primary key
Дата
Msg-id 19191.1126028579@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Poor performance of delete by primary key  (Mark Lewis <mark.lewis@mir3.com>)
Список pgsql-performance
Mark Lewis <mark.lewis@mir3.com> writes:
> I had a similar problem, so I downloaded 8.1 from CVS, ran it on a
> relatively gnarly dev workstation, imported a dump of my 8.0 database,
> and ran my troublesome queries with the new EXPLAIN ANALYZE.

> This process took about an hour and worked great, provided that you've
> actually named your foreign key constraints.  Otherwise, you'll find out
> that there's a trigger for a constraint called $3 that's taking up all
> of your time, but you won't know what table that constraint is on.

But at least you've got something you can work with.  Once you know the
name of the problem trigger you can look in pg_trigger to see which
other table it's connected to.  Try something like

    select tgname, tgconstrrelid::regclass, tgargs from pg_trigger
    where tgrelid = 'mytable'::regclass;

            regards, tom lane

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

Предыдущее
От: "Merlin Moncure"
Дата:
Сообщение: Re: insert performance for win32
Следующее
От: Carlos Henrique Reimer
Дата:
Сообщение: log_duration times