Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4D0CA475F86 for ; Mon, 28 Oct 2002 04:20:47 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id B9607475F85 for ; Mon, 28 Oct 2002 04:20:45 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id C3DF23818DB; Mon, 28 Oct 2002 04:20:44 -0500 (EST) From: "Gaetano Mendola" X-Newsgroups: comp.databases.postgresql.admin Subject: "Vacuum analyze" VS "recreate index" Date: Mon, 28 Oct 2002 10:20:45 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 44 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: pgsql-admin@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/263 X-Sequence-Number: 6121 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.