pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Carlo Stonebanks <stonec.register@sympatico.ca>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance Optimization for Dummies 2 - the SQL
Date: Sun, 15 Oct 2006 18:27:18 -0400
Message-ID: <2808.1160951238@sss.pgh.pa.us> (raw)
In-Reply-To: <egua6n$1fv4$1@news.hub.org>
References: <eft782$5a1$1@news.hub.org>
	<b42b73150610041407y3554f311u1329c4f3bdc53999@mail.gmail.com>
	<eg1dai$1tfa$1@news.hub.org>
	<b42b73150610042326v7fdeed17rf6b96e52a681a6db@mail.gmail.com>
	<eg2cds$29en$1@news.hub.org>
	<b42b73150610050630t76e9eedeh45a382729d35f2f6@mail.gmail.com>
	<eg611q$l0m$1@news.hub.org>
	<1160153623.6181.13.camel@state.g2switchworks.com>
	<b42b73150610061153i3d11d7a4r23e1d7c5317feb9f@mail.gmail.com>
	<eg6f8l$2det$1@news.hub.org>
	<b42b73150610090649y74c4dc99g176366921f784e7b@mail.gmail.com>
	<egua6n$1fv4$1@news.hub.org>

"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



view thread (38+ messages)  latest in thread

Message-ID: <2808.1160951238@sss.pgh.pa.us>
Permalink:  ../2808.1160951238@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2808.1160951238@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, stonec.register@sympatico.ca
  Subject: Re: Performance Optimization for Dummies 2 - the SQL
  In-Reply-To: <2808.1160951238@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox