Search Postgresql Archives

Re: Lengthy deletion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Herouth Maoz <herouth@xxxxxxxxxxxxx> writes:
> On 29/11/2011, at 09:13, Tom Lane wrote:
>> Yup, that's a clue all right.  I'll bet a nickel that you don't
>> have an index on the foreign key's referencing column (ie,
>> sent_messages.subscription_id).  That means each delete in
>> the referenced table has to seqscan the referencing table to
>> see if the delete would result in an FK violation.

> Makes sense. But shouldn't that be figured into the EXPLAIN plan?

If you run EXPLAIN ANALYZE, on a reasonably recent release, you'll see
the foreign-key trigger eating a lot of time.  Plain EXPLAIN doesn't
show triggers because it has no idea how much time they'll take.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux