Re: A little help interpreting a query plan - Mailing list pgsql-novice

From Tom Lane
Subject Re: A little help interpreting a query plan
Date
Msg-id 16209.1330041090@sss.pgh.pa.us
Whole thread Raw
In response to A little help interpreting a query plan  (Andy Chambers <achambers@mcna.net>)
List pgsql-novice
Andy Chambers <achambers@mcna.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

pgsql-novice by date:

Previous
From: Bartosz Dmytrak
Date:
Subject: Re: creating triggers: need help
Next
From: Ganesh Borse
Date:
Subject: Re: select on bytea column returns hex encoded data instead of binary data