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 81FE6D1B1C8 for ; Wed, 4 Aug 2004 12:51:07 -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 80565-04 for ; Wed, 4 Aug 2004 15:51:00 +0000 (GMT) Received: from boutiquenumerique.com (gailleton-2-82-67-9-10.fbx.proxad.net [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 813A8D1B1B4 for ; Wed, 4 Aug 2004 12:50:58 -0300 (ADT) Received: (qmail 5071 invoked from network); 4 Aug 2004 17:50:56 +0200 Received: from unknown (HELO musicbox) (192.168.0.2) by gailleton-2-82-67-9-10.fbx.proxad.net with SMTP; 4 Aug 2004 17:50:56 +0200 Date: Wed, 04 Aug 2004 17:50:56 +0200 To: "Rod Taylor" , "Valerie Schneider DSI/DEV" Subject: Re: Tuning queries on large database Cc: "Postgresql Performance" References: <200408041244.i74CihO19344@mu.meteo.fr> <1091625999.58593.47.camel@jester> From: =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?= Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <1091625999.58593.47.camel@jester> User-Agent: Opera M2/7.50 (Linux, build 673) 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/55 X-Sequence-Number: 7691 >> not so bad for oracle. What about for PG ? How data is stored I agree with the datatype issue. Smallint, bigint, integer... add a constraint... Also the way order of the records in the database is very important. As you seem to have a very large static population in your table, you should insert it, ordered by your favourite selection index (looks like it's poste). Also, you have a lot of static data which pollutes your table. Why not create two tables, one for the current year, and one for all the past years. Use a view to present a merged view.