Re: A little help interpreting a query plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andy Chambers <achambers(at)mcna(dot)net>
Cc: pgsql <pgsql-novice(at)postgresql(dot)org>
Subject: Re: A little help interpreting a query plan
Date: 2012-02-23 23:51:30
Message-ID: 16209.1330041090@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Andy Chambers <achambers(at)mcna(dot)net> writes:
> We have two copies of roughly* the same database (in a single
> cluster), and on one of them, the query above runs much faster and
> postgresql produces a different query plan for each one. It actually
> returns the same results in both instances. Can anyone think of why
> there is such a difference in performance?

Comparisons like this:

> -> Index Scan using claim_attachments_claim on
> claim_attachments ca (cost=0.00..10.10 rows=2 width=0) (actual
> time=0.004..0.004 rows=0 loops=1741)
> Index Cond: (claim_id = clm.id)

> -> Index Scan using claim_attachments_claim on
> claim_attachments ca (cost=0.00..10241.71 rows=2 width=0) (actual
> time=17.884..17.884 rows=0 loops=1741)
> Index Cond: (claim_id = clm.id)

make it appear that the "slow" DB is rather horribly bloated.
I wonder what your vacuuming policy is like ...

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Ganesh Borse 2012-02-24 03:29:29 Re: select on bytea column returns hex encoded data instead of binary data
Previous Message Bartosz Dmytrak 2012-02-23 21:26:33 Re: creating triggers: need help