Re: Slow Query

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: Marc McIntyre <mmcintyre(at)squiz(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow Query
Date: 2005-07-14 11:22:33
Message-ID: 1121340153.31360.22.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 2005-07-14 at 10:06 +1000, Marc McIntyre wrote:

> I'm having a problem with a query that performs a sequential scan on a
> table when it should be performing an index scan. The interesting thing
> is, when we dumped the database on another server, it performed an index
> scan on that server.
...
> The EXPLAIN ANALYZE from the system performing an sequential scan:
>
> QUERY PLAN
> Sort (cost=30079.79..30079.89 rows=42 width=113) (actual time=39889.989..39890.346 rows=260 loops=1)
...
> The EXPLAIN ANALYZE from the system performing an index scan scan:
> Sort (cost=16873.64..16873.74 rows=40 width=113) (actual time=2169.905..2169.912 rows=13 loops=1)

looks like the first query is returning 260 rows,
but the second one 13

this may not be your problem, but are you sure you are using the same
query on the same data here ?

gnari

In response to

  • Slow Query at 2005-07-14 00:06:34 from Marc McIntyre

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Grega Bremec 2005-07-14 12:15:52 Re: JFS fastest filesystem for PostgreSQL?
Previous Message Michael Stone 2005-07-14 10:30:40 Re: JFS fastest filesystem for PostgreSQL?