Re: Very slow joins

From: MS <fretka1990(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Very slow joins
Date: 2009-07-25 09:36:19
Message-ID: d1855c3a-63a6-4e51-81eb-6ae9711043c1@y7g2000yqa.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> can we see an explain analyze at least?
>

Hi,
Well, it won't be necessary - I mean it looks just like the explain I
sent in my first post.
BUT I found the real cause of my problem - the "fk2" field from my
example had not only an index, but it was also a foreign key to
another table.
I believe the update took so long because pgsql was checking if the
changes don't break the referential integrity.
When I dropped the FK constraint (and index too - just in case) the
update took around 3 minutes which is acceptable.
So - problem solved, postgres good. ;) But isn't there a way to make
some bulk operations without having to drop indexes/FKs?
Something that would work like:

begin transaction + forget about RI
make some lenghty operation (update/delete...)
if RI is OK then commit; else rollback

Thanks,
MS

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2009-07-25 11:23:29 Re: Disable databse listing for non-superuser (\l) ?
Previous Message Craig Ringer 2009-07-25 07:57:33 Re: Copying only incremental records to another DB..