Re: Query runs too long for indexed tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrus" <eetasoft(at)online(dot)ee>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query runs too long for indexed tables
Date: 2006-04-05 14:09:55
Message-ID: 27543.1144246195@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Andrus" <eetasoft(at)online(dot)ee> writes:
> UPDATE firma1.rid SET toode=NULL
> WHERE toode IS NOT NULL AND
> toode NOT IN (SELECT TOODE FROM firma1.TOODE);

> How to speed this up ?

Increasing work_mem to the point where you get a hashed NOT-IN would
help, probably. Have you tried using EXPLAIN to see what the plan is
for the UPDATEs?

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Juan Casero (FL FLC) 2006-04-05 18:12:54 Sun Fire T2000 and PostgreSQL 8.1.3
Previous Message PFC 2006-04-05 11:25:05 Re: Query runs too long for indexed tables