X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 7CB9A9DCA86 for ; Mon, 30 Jan 2006 18:57:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98821-02 for ; Mon, 30 Jan 2006 18:57:18 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 947529DCA66 for ; Mon, 30 Jan 2006 18:57:14 -0400 (AST) Received: from rose.easter-eggs.fr (coquelicot-sdsl.easter-eggs.com [213.215.37.94]) by svr4.postgresql.org (Postfix) with ESMTP id A757E5AF08A for ; Mon, 30 Jan 2006 22:57:17 +0000 (GMT) Received: from pavot.easter-eggs.fr (pavot.easter-eggs.fr [10.0.0.26]) by rose.easter-eggs.fr (Postfix) with ESMTP id EC68DBB for ; Mon, 30 Jan 2006 23:57:14 +0100 (CET) Received: by pavot.easter-eggs.fr (Postfix, from userid 1013) id 527335BAF3; Mon, 30 Jan 2006 23:57:12 +0100 (CET) Date: Mon, 30 Jan 2006 23:57:11 +0100 From: Emmanuel Lacour To: pgsql-performance@postgresql.org Subject: Query planner issue Message-ID: <20060130225711.GE1320@easter-eggs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200601/481 X-Sequence-Number: 16959 Hi everybody, I have the following problem, on a test server, if I do a fresh import of production data then run 'explain analyze select count(*) from mandats;' I get this result: Aggregate (cost=6487.32..6487.32 rows=1 width=0) (actual time=607.61..607.61 rows=1 loops=1) -> Seq Scan on mandats (cost=0.00..6373.26 rows=45626 width=0) (actual time=0.14..496.20 rows=45626 loops=1) Total runtime: 607.95 msec On the production server, if I do the same (without other use of the server), I get: Aggregate (cost=227554.33..227554.33 rows=1 width=0) (actual time=230705.79..230705.79 rows=1 loops=1) -> Seq Scan on mandats (cost=0.00..227440.26 rows=45626 width=0) (actual time=0.03..230616.64 rows=45760 loops=1) Total runtime: 230706.08 msec Is there anyone having an idea on how yo solve this poor performances? I think it is caused by many delete/insert on this table every day, but how to solve it, I need to run this qury each hour :(. I run vacuum each night, postgresql is unfortunatly 7.2.1 :( (no upgrade before 2 or 3 months). -- Emmanuel Lacour ------------------------------------ Easter-eggs 44-46 rue de l'Ouest - 75014 Paris - France - Métro Gaité Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 41 35 00 76 mailto:elacour@easter-eggs.com - http://www.easter-eggs.com