Re: Performance Optimization for Dummies 2 - the SQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Carlo Stonebanks" <stonec(dot)register(at)sympatico(dot)ca>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance Optimization for Dummies 2 - the SQL
Date: 2006-10-15 22:27:18
Message-ID: 2808.1160951238@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Carlo Stonebanks" <stonec(dot)register(at)sympatico(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Carlo Stonebanks 2006-10-15 22:48:28 Re: Performance Optimization for Dummies 2 - the SQL
Previous Message Carlo Stonebanks 2006-10-15 21:46:13 Re: Performance Optimization for Dummies 2 - the SQL