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 1AB4A5E46F3 for ; Tue, 31 Aug 2004 17:24:57 -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 50095-08 for ; Tue, 31 Aug 2004 20:24:51 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.194]) by svr1.postgresql.org (Postfix) with ESMTP id 496595E46CD for ; Tue, 31 Aug 2004 17:24:49 -0300 (ADT) Received: by mproxy.gmail.com with SMTP id 73so192573rnk for ; Tue, 31 Aug 2004 13:24:51 -0700 (PDT) Received: by 10.38.3.58 with SMTP id 58mr1213973rnc; Tue, 31 Aug 2004 13:24:51 -0700 (PDT) Received: by 10.38.86.41 with HTTP; Tue, 31 Aug 2004 13:24:51 -0700 (PDT) Message-ID: <4b09a0c04083113243b6198b8@mail.gmail.com> Date: Tue, 31 Aug 2004 22:24:51 +0200 From: Jean-Max Reymond Reply-To: Jean-Max Reymond To: Gary Doades Subject: Re: Optimizing a request Cc: pgsql-performance@postgresql.org In-Reply-To: <4134EABE.28891.4E1B76A@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <4134DDDD.428.4AF67CC@localhost> <4134EABE.28891.4E1B76A@localhost> 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/484 X-Sequence-Number: 8120 On Tue, 31 Aug 2004 21:16:46 +0100, Gary Doades wrote: > I can only presume you mean 1 GB RAM. What exactly are your > settings for shared buffers and effective_cache_size? for 1 GB RAM, shared_buffers = 65536 effective_cache_size = 16384 > > Can you increase default_statistics_target and re-test? It is possible > that with such a large table that the distribution of values is skewed and > postgres does not realise that an index scan would be better. OK, tomorrow, I'll try with the new value of default_statistics_target > It seems very odd otherwise that only on row out of 10,000,000 could > match and postgres does not realise this. > > Can you post an explain analyse (not just explain) for this query? yes, of course -- Jean-Max Reymond CKR Solutions http://www.ckr-solutions.com