Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id E62D98B63D8 for ; Wed, 20 Jun 2012 10:43:12 -0300 (ADT) Received: from li339-205.members.linode.com ([96.126.114.205] helo=squeakycode.net) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ShLBe-0002ZS-Jq for pgsql-performance@postgresql.org; Wed, 20 Jun 2012 13:43:12 +0000 Received: from [192.168.10.84] (97-64-237-59.client.mchsi.com [97.64.237.59]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: andy) by squeakycode.net (Postfix) with ESMTPSA id 090CCC8BC1; Wed, 20 Jun 2012 09:42:55 -0400 (EDT) Message-ID: <4FE1D365.2010204@squeakycode.net> Date: Wed, 20 Jun 2012 08:43:01 -0500 From: Andy Colson User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Eyal Wilde CC: pgsql-performance@postgresql.org Subject: Re: scale up (postgresql vs mssql) References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/108 X-Sequence-Number: 47134 On 6/20/2012 1:01 AM, Eyal Wilde wrote: > Hi, all. > > this is an obligation from the past: > http://archives.postgresql.org/pgsql-performance/2012-05/msg00017.php > > the same test, that did ~230 results, is now doing ~700 results. that > is, BTW even better than mssql. > > the ultimate solution for that problem was to NOT to do "ON COMMIT > DELETE ROWS" for the temporary tables. instead, we just do "DELETE FROM > temp_table1". > > doing "TRUNCATE temp_table1" is defiantly the worst case (~100 results > in the same test). this is something we knew for a long time, which is > why we did "ON COMMIT DELETE ROWS", but eventually it turned out as far > from being the best. > > another minor issue is that when configuring > temp_tablespace='other_tablespace', the sequences of the temporary > tables remain on the 'main_tablespace'. > > i hope that will help making postgres even better :) > Did you ever try re-writing some of the temp table usage to use subselect's/views/cte/etc? -Andy