Re: Performance Optimization for Dummies 2 - the SQL - Mailing list pgsql-performance

From Tom Lane
Subject Re: Performance Optimization for Dummies 2 - the SQL
Date
Msg-id 2808.1160951238@sss.pgh.pa.us
Whole thread Raw
In response to Re: Performance Optimization for Dummies 2 - the SQL  ("Carlo Stonebanks" <stonec.register@sympatico.ca>)
List pgsql-performance
"Carlo Stonebanks" <stonec.register@sympatico.ca> writes:
> Curiously, it's using index scans, and it really looks like a simple query
> to me. I am completely baffled. The two tables in question have about 800K
> rows each - not exactly an incredible number. The EXPLAIN is simple, but the
> performance is dreadful. All the other queries run much faster than this -
> does ANYTHING about this query strike you as odd?

Lots of dead rows perhaps?  The EXPLAIN estimates look a bit out of line
--- 11483 cost units to fetch 47 index entries is an order or two of
magnitude higher than it ought to be.  The real time also seems to be
concentrated in that index scan.  What are the physical sizes of the
table and index?  (VACUUM VERBOSE output for the facility table might
tell something.)

            regards, tom lane

pgsql-performance by date:

Previous
From: "Carlo Stonebanks"
Date:
Subject: Re: Performance Optimization for Dummies 2 - the SQL
Next
From: "Carlo Stonebanks"
Date:
Subject: Re: Performance Optimization for Dummies 2 - the SQL