X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E0F265E46ED for ; Tue, 17 Aug 2004 11:16:16 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91444-03 for ; Tue, 17 Aug 2004 14:16:16 +0000 (GMT) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by svr1.postgresql.org (Postfix) with ESMTP id 312855E46EC for ; Tue, 17 Aug 2004 11:16:13 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 1Bx4l8-0002RN-0W; Tue, 17 Aug 2004 14:16:19 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 5608418658; Tue, 17 Aug 2004 15:16:16 +0100 (BST) Message-ID: <4122132E.80603@archonet.com> Date: Tue, 17 Aug 2004 15:16:14 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) X-Accept-Language: en-us, en MIME-Version: 1.0 To: olivier HARO Cc: pgsql-performance@postgresql.org Subject: Re: General performance problem! References: <002901c4845e$5d1dc1c0$0c0101c0@saturne> In-Reply-To: <002901c4845e$5d1dc1c0$0c0101c0@saturne> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/256 X-Sequence-Number: 7892 olivier HARO wrote: > This table contains 5 000 000 records > > I have a PHP application which often makes queries on this table (especially on the "cp","naf","effectif" fields) > > Querries are like : > select (distint cp) from base_aveugle where cp='201A' and effectif between 1 and 150 > select (*) from base_aveugle where naf in ('721A','213F','421K') and cp in ('54210','21459','201A') and effectif < 150 We'll need to know what version of PostgreSQL you're using and also what the output of EXPLAIN ANALYZE shows for your example queries. -- Richard Huxton Archonet Ltd