X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8D510D1D779 for ; Mon, 16 Feb 2004 03:28:54 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 78012-02 for ; Sun, 15 Feb 2004 23:28:56 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id F1536D1D643 for ; Sun, 15 Feb 2004 23:28:51 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i1G3SnDn017528; Sun, 15 Feb 2004 22:28:49 -0500 (EST) To: "Marinos J. Yannikos" Cc: Jeff Trout , pgsql-performance@postgresql.org Subject: Re: optimization ideas for frequent, large(ish) updates In-reply-to: <4030309B.7090807@geizhals.at> References: <402C213A.4030105@geizhals.at> <200402122228.41680.josh@agliodbs.com> <402ED348.7000800@geizhals.at> <460CEC02-5FDB-11D8-8142-000D9366F0C4@jefftrout.com> <4030309B.7090807@geizhals.at> Comments: In-reply-to "Marinos J. Yannikos" message dated "Mon, 16 Feb 2004 03:53:15 +0100" Date: Sun, 15 Feb 2004 22:28:48 -0500 Message-ID: <17527.1076902128@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/169 X-Sequence-Number: 5693 "Marinos J. Yannikos" writes: > Jeff Trout wrote: >> Remember that it is going to allocate 800MB per sort. > I didn't know that it always allocates the full amount of memory > specificed in the configuration It doesn't ... but it could use *up to* that much before starting to spill to disk. If you are certain your sorts won't use that much, then you could set the limit lower, hm? Also keep in mind that sort_mem controls hash table size as well as sort size. The hashtable code is not nearly as accurate as the sort code about honoring the specified limit exactly. So you really oughta figure that you could need some multiple of sort_mem per active backend. regards, tom lane