Re: Performance Killer 'IN' ? - Mailing list pgsql-general

From Tom Lane
Subject Re: Performance Killer 'IN' ?
Date
Msg-id 8566.1143819939@sss.pgh.pa.us
Whole thread Raw
In response to Re: Performance Killer 'IN' ?  (Kai Hessing <kai.hessing@hobsons.de>)
Responses Re: Performance Killer 'IN' ?  (Kai Hessing <kai.hessing@hobsons.de>)
List pgsql-general
Kai Hessing <kai.hessing@hobsons.de> writes:
> Index Scan using phon_phon_idx on phon  (cost=0.00..5193.83 rows=530
> width=148) (actual time=0.146..0.146 rows=0 loops=1)
> ...
> Seq Scan on phon  (cost=0.00..1573304.58 rows=105931 width=148) (actual
> time=369563.565..369563.565 rows=0 loops=1)

You need to look into the discrepancy between estimated and actual row
counts.  (I suppose the reason you're showing 0 rows here is that you
already did these UPDATEs and so none of the rows in question pass the
status filter --- but how many rows are there matching the phon index
conditions?)  Perhaps a larger statistics target for the phon column
would be a good idea.

            regards, tom lane

pgsql-general by date:

Previous
From: "Marko Kreen"
Date:
Subject: Re: Performance Killer 'IN' ?
Next
From: Tom Lane
Date:
Subject: Re: How to use result column names in having cause