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 CB73E5E46E9 for ; Tue, 17 Aug 2004 12:41:41 -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 33456-06 for ; Tue, 17 Aug 2004 15:41:45 +0000 (GMT) Received: from mail.aspserveur.com (7.95.39-62.rev.gaoland.net [62.39.95.7]) by svr1.postgresql.org (Postfix) with ESMTP id 4FD975E46E2 for ; Tue, 17 Aug 2004 12:41:35 -0300 (ADT) Received: from saturne ([193.251.84.117]) by mail.aspserveur.com (ASPSERVEUR Ultimate mail Server) with SMTP id HUO74536 for ; Tue, 17 Aug 2004 17:42:08 +0200 Message-ID: <001901c48470$b1b92140$0c0101c0@saturne> From: "olivier HARO" To: Subject: Re: General performance problem! Date: Tue, 17 Aug 2004 17:41:41 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 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/258 X-Sequence-Number: 7894 Thanks for the tip for the index on multiple columns ! (I never do inserts on this table so insert time doesn't matter) Mys posgresql version is : PostgreSQL 7.2.1 Here are the results of the EXPLAIN ANALYZE you asked me to execute. explain analyse select cp from base_aveugle where cp='69740' and effectif between 1 and 50; NOTICE: QUERY PLAN: Index Scan using base_aveugle_cp_eff on base_aveugle (cost=0.00..508.69 rows=126 width=32) (actual time=0.27..11.56 rows=398 loops=1) Total runtime: 11.77 msec EXPLAIN explain analyse select cp from base_aveugle where cp like '69%' and effectif between 1 and 50 and naf like '24%' or naf like '25%'; NOTICE: QUERY PLAN: Index Scan using base_aveugle_cp_eff_naf, base_aveugle_naf on base_aveugle (cost=0.00..100001.89 rows=25245 width=32) (actual time=4.40..353.69 rows=6905 loops=1) Total runtime: 355.82 msec EXPLAIN thx ;) --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.737 / Virus Database: 491 - Release Date: 11/08/2004