Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id EC48D6327FB for ; Fri, 10 Sep 2010 22:59:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 24660-10 for ; Sat, 11 Sep 2010 01:59:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tamriel.snowman.net (tamriel.snowman.net [72.66.115.51]) by mail.postgresql.org (Postfix) with ESMTP id CE125630749 for ; Fri, 10 Sep 2010 22:59:05 -0300 (ADT) Received: by tamriel.snowman.net (Postfix, from userid 1000) id 65D29231FD; Fri, 10 Sep 2010 21:59:03 -0400 (EDT) Date: Fri, 10 Sep 2010 21:59:03 -0400 From: Stephen Frost To: Mason Harding Cc: pgsql-performance@postgresql.org Subject: Re: Slow SQL lookup due to every field being listed in SORT KEY Message-ID: <20100911015903.GG26232@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bHoIUPdzgh/2fjbD" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/2.6.26-1-amd64 (x86_64) X-Uptime: 21:57:26 up 379 days, 13:22, 16 users, load average: 0.08, 0.04, 0.02 User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/48 X-Sequence-Number: 40251 --bHoIUPdzgh/2fjbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Mason Harding (mason.harding@gmail.com) wrote: > Hi all. I Have the following query (tested in postgres 8.4 and 9.0rc1) Can you provide \d output from all the tables involved..? Also, what does the query plan look like w/o 'enable_seqscan=off' (which is not a good setting to use...)? Increasing work_mem is often a good idea if your system can afford it based on the number/kind of queries running concurrently. Note that you can also increase that setting for just a single role, single session, or even single query. Thanks, Stephen --bHoIUPdzgh/2fjbD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkyK4mcACgkQrzgMPqB3kiiZvQCgm56ThanzOoQKJpFsSswfsrhs rI4AnAmaBXEfDra3llxOQO2HsvRn7S6k =pRCe -----END PGP SIGNATURE----- --bHoIUPdzgh/2fjbD--