Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 2CAC4634669 for ; Wed, 11 Mar 2009 01:54:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 57978-01 for ; Wed, 11 Mar 2009 01:53:57 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.30]) by mail.postgresql.org (Postfix) with ESMTP id 82BA7633744 for ; Wed, 11 Mar 2009 01:53:57 -0300 (ADT) Received: by yw-out-2324.google.com with SMTP id 5so273596ywh.73 for ; Tue, 10 Mar 2009 21:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cMpzMGv0r/kDORQ0a0CqtgQB+hO+stNnHk7Rtz7cV/8=; b=cXKKFgAEodTOFX8aEHYYn/iZAZDE5/DKGcjIWef3RaOKcUexm2VXokF7dIgJ6wezoF 0qPKnrRtAcJw59dw+zp//f24PTwD7WQ2cGcO1E0p4RGKfH5AlttyLzdnt6fVopimCiHX ZWQ+/0QCiH2idQGWbx0WMYqlTOyKCG0/Nb9uQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=OI03/Dw+iEx9Rd+pIuzbllEsAGfLIRmbVMMQDu0bT0GaY02gfDTkgaypXYWUdErRSN oSEIYE9mystb2HWX7vjcJB7TEToivXU7g1XXv1YZJcQM/S8phMkJit09PQEL9jhLdcaO HYT/DCpaGGJaYPHOqsqx4Rm9xUJg9LVa79AIY= MIME-Version: 1.0 Received: by 10.150.225.17 with SMTP id x17mr6445015ybg.157.1236747236566; Tue, 10 Mar 2009 21:53:56 -0700 (PDT) In-Reply-To: References: Date: Tue, 10 Mar 2009 22:53:56 -0600 Message-ID: Subject: Re: Query performance over a large proportion of data From: Scott Marlowe To: smclellan@mintel.com Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/93 X-Sequence-Number: 33015 On Tue, Mar 10, 2009 at 9:15 PM, Steve McLellan wrote: > Thanks - the nested loop is indeed causing problems - reducing > seq_page_cost had the same effect of removing the nested loop for this > query. We'd noticed the poor row count estimation. Increasing the statistics > doesn't seem to have much effect, but we'll have more of a go with it. More than likely it's the sequential page cost versus the cpu_xxx cost setttings that's really making the difference. I.e. if you raised the cpu_xxx settings you'd get the same result. But I'm not sure, just a guess.