Re: Index Backward Scan fast / Index Scan slow ! (Modifié par Pailloncy Jean-Gérard)

From: Pailloncy Jean-Gérard <pailloncy(at)ifrance(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Index Backward Scan fast / Index Scan slow ! (Modifié par Pailloncy Jean-Gérard)
Date: 2004-04-12 19:02:02
Message-ID: 1D4DEBDC-8CB4-11D8-80FD-000A95DE2550@ifrance.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

> In 7.4 a VACUUM should be sufficient ... or at least, if it isn't
Atfer VACUUM:
dps=# explain analyze select next_index_time from url order by
next_index_time desc limit 1;

QUERY PLAN
------------------------------------------------------------------------
------------------------------------------------------------------------
--
Limit (cost=0.00..2.62 rows=1 width=4) (actual time=0.098..0.099
rows=1 loops=1)
-> Index Scan Backward using url_next_index_time on url
(cost=0.00..814591.03 rows=310913 width=4) (actual time=0.096..0.096
rows=1 loops=1)
Total runtime: 0.195 ms
(3 rows)

dps=# explain analyze select next_index_time from url order by
next_index_time asc limit 1;

QUERY PLAN
------------------------------------------------------------------------
------------------------------------------------------------------------
-
Limit (cost=0.00..2.62 rows=1 width=4) (actual
time=13504.105..13504.106 rows=1 loops=1)
-> Index Scan using url_next_index_time on url
(cost=0.00..814591.03 rows=310913 width=4) (actual
time=13504.099..13504.099 rows=1 loops=1)
Total runtime: 13504.158 ms
(3 rows)

Better, but......

Cordialement,
Jean-Gérard Pailloncy

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jeremy Dunn 2004-04-12 19:05:02 Re: index v. seqscan for certain values
Previous Message Tom Lane 2004-04-12 17:51:28 Re: index v. seqscan for certain values