Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E3FE7633A32 for ; Mon, 11 Jan 2010 15:41:37 -0400 (AST) 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 73536-01-6 for ; Mon, 11 Jan 2010 19:41:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wizmail.org (wizmail.org [217.146.107.12]) by mail.postgresql.org (Postfix) with ESMTP id 79E7B633B75 for ; Mon, 11 Jan 2010 15:41:12 -0400 (AST) Received: from ebony.jgh.adsl.wizards.co.uk ([217.146.123.59]) (from_AS 16353) by wizmail.org with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.69) id 1NUQ8V-0004ra-7O (return-path ); Mon, 11 Jan 2010 19:41:11 +0000 Message-ID: <4B4B7ED4.8070208@wizmail.org> Date: Mon, 11 Jan 2010 19:41:08 +0000 From: Jeremy Harris User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090320 Fedora/2.0.0.21-1.fc9 Thunderbird/2.0.0.21 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Choice of bitmap scan over index scan References: <4B49DE7F.8080808@wizmail.org> <603c8f071001101853p6dd9517bofb7fcef43c97d79e@mail.gmail.com> In-Reply-To: <603c8f071001101853p6dd9517bofb7fcef43c97d79e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=AWL=0.000, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/212 X-Sequence-Number: 37092 On 01/11/2010 02:53 AM, Robert Haas wrote: > On Sun, Jan 10, 2010 at 9:04 AM, Jeremy Harris wrote: >> Needing to use an external (on-disk) sort method, when taking >> only 90MB, looks odd. [...] > Well, you'd need to have work_mem> 90 MB for that not to happen, and > very few people can afford to set that setting that high. If you have > a query with three or four sorts using 90 MB a piece, and five or ten > users running them, you can quickly kill the box... Oh. That's, um, a real pity given the cost of going external. Any hope of a more dynamic allocation of memory resource in the future? Within a single query plan, the number of sorts is known; how about a sort-mem limit per query rather than per sort (as a first step)? Cheers, Jeremy