Re: Poor performance for delete query
| От | Tom Lane |
|---|---|
| Тема | Re: Poor performance for delete query |
| Дата | |
| Msg-id | 29874.1398374703@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Poor performance for delete query (Jonatan Evald Buus <jonatan.buus@cellpointmobile.com>) |
| Ответы |
Re: Poor performance for delete query
|
| Список | pgsql-performance |
Jonatan Evald Buus <jonatan.buus@cellpointmobile.com> writes:
> On 24 April 2014 22:29, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I'd really have to bet that you forgot to index one of the referencing
>> tables.
> *That was our first thought, so we went through the child tables to check
> but apparently we missed some. (please see below for the difference in the
> explain analyze output)*
I'm confused. Your second EXPLAIN ANALYZE looks like you fixed the
problem. Are you still thinking there's an issue?
> Why is "order2transaction_fk" being triggered twice? Is that because
> there're two affected rows?
No, I'd have expected a delete of multiple rows to show as calls=N,
not N separate entries.
Maybe there are recursive queries buried under here somewhere?
That is, are you expecting any of the cascaded deletes to cascade further?
I don't recall exactly what EXPLAIN is likely to do with such cases.
regards, tom lane
В списке pgsql-performance по дате отправления: