Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 915B69FB306 for ; Tue, 17 Oct 2006 03:44:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 61201-06 for ; Tue, 17 Oct 2006 03:44:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 0E9479FB1E2 for ; Tue, 17 Oct 2006 03:44:06 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 2757430E0A; Tue, 17 Oct 2006 08:44:05 +0200 (MET DST) From: "Carlo Stonebanks" X-Newsgroups: pgsql.performance Subject: Re: Performance Optimization for Dummies 2 - the SQL Date: Tue, 17 Oct 2006 02:43:57 -0400 Organization: Hub.Org Networking Services Lines: 17 Message-ID: References: <1160153623.6181.13.camel@state.g2switchworks.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.057 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/311 X-Sequence-Number: 21440 > you have a two part part key on facility(country code, postal code), > right? Well, I'm glad you pointed it out, because I THOUGhT I had created it, but apparently I haven't -- I only noticed that it was missing after I listed all the other indexes. Looks like this query is one of the victims of a db structure corruption I suffered when transferring the schema over from development into production. (Well, that's my excuse and I'm sticking to it!) Thanks for all the help - I've reduced the execution time to 1/10 of its original time. Carlo