Re: ORDER BY ... LIMIT and JOIN - Mailing list pgsql-performance

From Robert Haas
Subject Re: ORDER BY ... LIMIT and JOIN
Date
Msg-id 603c8f070908091830o69cc4889ua37ccc7dc2b1ab04@mail.gmail.com
Whole thread Raw
In response to Re: ORDER BY ... LIMIT and JOIN  (Fizu <Fizu@advancedsl.com.ar>)
List pgsql-performance
On Sun, Aug 9, 2009 at 3:26 PM, Fizu<Fizu@advancedsl.com.ar> wrote:
>               ->  Index Scan using country_ranking_user_idx on "user"
>  (cost=0.00..4807.25 rows=1710 width=143) (actual
> time=20.923..4898.931 rows=1972 loops=1)
>                     Index Cond: (country_id = 5)

An index scan that picks up 1972 rows is taking 5 seconds?  I think
there must be something wrong with this index.  Is it possible that
since you apparently weren't analyzing this database, that maybe you
didn't vacuum it either?  If so, you should probably do a VACUUM FULL
on your database and then a database-wide REINDEX, but at a minimum
you should try reindexing this particular index.

...Robert

pgsql-performance by date:

Previous
From: Michael Andreen
Date:
Subject: Re: ORDER BY ... LIMIT and JOIN
Next
From: Ip Wing Kin John
Date:
Subject: Re: Bottleneck?