Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id CA0E51337B58 for ; Mon, 22 Nov 2010 08:22:51 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 73949-07 for ; Mon, 22 Nov 2010 12:22:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from elizabeth.gransy.com (elizabeth.gransy.com [89.187.132.199]) by mail.postgresql.org (Postfix) with ESMTP id 5F8F113364DE for ; Mon, 22 Nov 2010 08:22:44 -0400 (AST) Received: from sq.gransy.com (localhost [127.0.0.1]) by elizabeth.gransy.com (Postfix) with ESMTP id 1EDF215E42AA; Mon, 22 Nov 2010 13:22:43 +0100 (CET) Received: from 89.103.152.5 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Mon, 22 Nov 2010 13:22:43 +0100 Message-ID: In-Reply-To: References: <3ba1d0462bc7df1c3eb5a6d4777ce08a.squirrel@sq.gransy.com> <22586.1290359761@sss.pgh.pa.us> Date: Mon, 22 Nov 2010 13:22:43 +0100 Subject: Re: Query Performance SQL Server vs. Postgresql From: tv@fuzzy.cz To: "Samuel Gendler" Cc: pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-10 required=5 tests=BAYES_20=-0.001 X-Spam-Level: X-Archive-Number: 201011/354 X-Sequence-Number: 41378 > I believe you can set work_mem to a different value just for the duration > of > a single query, so you needn't have work_mem set so high if for every > query > on the system. A single query may well use a multiple of work_mem, so you > really probably don't want it that high all the time unless all of your > queries are structured similarly. Just set work_mem='2047MB'; query; > reset > all; Yes, executing "set work_mem='64MB'" right before the query should be just fine. Setting work_mem to 2GB is an overkill most of the time (99.99999%). Tomas