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

From Pailloncy Jean-Gérard
Subject Re: Index Backward Scan fast / Index Scan slow ! (Modifié par Pailloncy Jean-Gérard)
Date
Msg-id 1D4DEBDC-8CB4-11D8-80FD-000A95DE2550@ifrance.com
Whole thread Raw
Responses Re: Re: Index Backward Scan fast / Index Scan slow ! (Modifié par Pailloncy Jean-Gérard)
List 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


pgsql-performance by date:

Previous
From: Pailloncy Jean-Gérard
Date:
Subject: Re: Index Backward Scan fast / Index Scan slow !
Next
From: "Jeremy Dunn"
Date:
Subject: Re: index v. seqscan for certain values