pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: pgsql-admin@postgresql.org
Subject: "Vacuum analyze" VS  "recreate index"
Date: Mon, 28 Oct 2002 10:20:45 +0100
Message-ID: <apivhb$29ac$1@news.hub.org> (raw)

Hi all,
today I had a strange beaviour on a table with a partial index:

push=# select count(*) from jobs;
 count
--------
 426197
(1 row)

push=# select count(*) from jobs where status = 'r';
 count
-------
     6
(1 row)

the partial index is defined like this:
create index idx_jobs_status_r on jobs (status ) where status in
('r','0','a');

when I did this ( one month ago ) the query was running fine like:

push=# explain analyze select * from jobs where status = 'r';
NOTICE:  QUERY PLAN:

Index Scan using idx_jobs_status_r on jobs  (cost=0.00..2.11 rows=1
width=49) (actual time=0.07..0.80 rows=5 loops=1)
Total runtime: 0.90 msec

Today (before to drop the index and recreate it ) I had for the same query
a
Total runtime of ~ 10 secs.



I tried to do vacuum analyze but the total time remained the same.
Now I'm wandering about if I should do drop that index and
recreate it instead of do a vacuum analyze during the night.

Ciao
Gaetano.







Message-ID: <apivhb$29ac$1@news.hub.org>
Permalink:  ../apivhb$29ac$1@news.hub.org/
Also on:    postgresql.org/message-id/apivhb$29ac$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mendola@bigfoot.com
  Subject: Re: "Vacuum analyze" VS  "recreate index"
  In-Reply-To: <apivhb$29ac$1@news.hub.org>
  References: <apivhb$29ac$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox