Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 6AEB29FB35C for ; Wed, 18 Oct 2006 11:15:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 94518-01 for ; Wed, 18 Oct 2006 14:15:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from serveurmail01.codata.be (125.123.146.82.ipv4.evonet.be [82.146.123.125]) by postgresql.org (Postfix) with ESMTP id 717889FB2E0 for ; Wed, 18 Oct 2006 11:15:15 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by serveurmail01.codata.be (Postfix) with ESMTP id 7F29B183878D; Wed, 18 Oct 2006 16:15:14 +0200 (CEST) X-DSPAM-Result: Innocent X-DSPAM-Processed: Wed Oct 18 16:15:14 2006 X-DSPAM-Confidence: 0.9997 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 453636f2158739350649784 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at Received: from serveurmail01.codata.be ([127.0.0.1]) by localhost (serveurmail01.codata.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d7qAeBgemt2D; Wed, 18 Oct 2006 16:15:13 +0200 (CEST) Received: from [127.0.0.1] (103.186-112-217.adsl.belcenter.be [217.112.186.103]) by serveurmail01.codata.be (Postfix) with ESMTP id 78C94183878B; Wed, 18 Oct 2006 16:15:13 +0200 (CEST) Message-ID: <453636F1.7000903@freesurf.fr> Date: Wed, 18 Oct 2006 16:15:13 +0200 From: Arnaud Lesauvage User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Heikki Linnakangas CC: pgsql-performance@postgresql.org Subject: Re: Index on two columns not used References: <45360E25.9010403@freesurf.fr> <45361295.9050504@enterprisedb.com> <45361A2D.6080702@freesurf.fr> <453632C5.50501@enterprisedb.com> In-Reply-To: <453632C5.50501@enterprisedb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 0642-1, 18/10/2006), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.335 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/355 X-Sequence-Number: 21484 Heikki Linnakangas a écrit : > Arnaud Lesauvage wrote: >> This query was taken from my "adminsitrative areas" model (continents, >> countries, etc...). Whenever I query this model, I have to join many >> tables. >> I don't really know what the overhead of reading the heap-tuples is, but >> would it be a good idea to add data-redundancy in my tables to avoid >> joins ? (adding country_id, continent_id, etc... in the "cities" table) > > It depends. I would advise not to denormalize unless you really really > have to. It's hard to say without more knowledge of the application. > > Is the query you showed a typical one? It ran in about 160 ms, is that > good enough? It's doesn't sound too bad, considering that it returned > almost 40000 rows. It is quite typical, yes. It is the base query of a view. In fact, most views have a lot more joins (they join with all the upper-level tables). But 150ms is OK, indeed.