Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 51C1C1337BF2 for ; Sat, 16 Apr 2011 20:19:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 13512-03 for ; Sat, 16 Apr 2011 23:19:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.catalyst.net.nz (bertrand.catalyst.net.nz [202.78.240.40]) by mail.postgresql.org (Postfix) with ESMTP id 121DE1337BEF for ; Sat, 16 Apr 2011 20:19:03 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 3DBD531FAE for ; Sun, 17 Apr 2011 11:19:01 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zolq8AVX-nK1 for ; Sun, 17 Apr 2011 11:18:56 +1200 (NZST) Received: from [192.168.1.11] (122-60-64-230.jetstream.xtra.co.nz [122.60.64.230]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id E86B031C38 for ; Sun, 17 Apr 2011 11:18:55 +1200 (NZST) Message-ID: <4DAA23DE.5080106@catalyst.net.nz> Date: Sun, 17 Apr 2011 11:18:54 +1200 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: Massive memory use for star query References: <4DA7CB25.5040102@catalyst.net.nz> In-Reply-To: <4DA7CB25.5040102@catalyst.net.nz> Content-Type: multipart/mixed; boundary="------------020302010907050201000908" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/126 X-Sequence-Number: 30045 This is a multi-part message in MIME format. --------------020302010907050201000908 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 15/04/11 16:35, Mark Kirkwood wrote: > Here's a simplified example using synthetic data (see attached to > generate if desired): > For anyone else who might be want to play with this: Patch with correction to make the directory reassignment work correctly, plus an additional comment in the README mentioning the need to set this in the generator and loading scripts. Thanks Mark --------------020302010907050201000908 Content-Type: text/x-patch; name="starjoin-dirs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="starjoin-dirs.patch" diff -c starjoin.orig/gendata.pl starjoin/gendata.pl *** starjoin.orig/gendata.pl 2011-04-17 10:55:28.252595067 +1200 --- starjoin/gendata.pl 2011-04-17 10:55:48.684595066 +1200 *************** *** 14,20 **** my %prevcatids; print "generate cat\n"; ! open(FH, "> /data0/dump/cat.dat") || die ("cannot open cat.dat: $!"); for ($i = 0; $i < $catrows; $i++) { $catid = $i; --- 14,20 ---- my %prevcatids; print "generate cat\n"; ! open(FH, "> $dir/cat.dat") || die ("cannot open cat.dat: $!"); for ($i = 0; $i < $catrows; $i++) { $catid = $i; diff -c starjoin.orig/README starjoin/README *** starjoin.orig/README 2011-04-17 10:55:28.252595067 +1200 --- starjoin/README 2011-04-17 10:56:29.292595065 +1200 *************** *** 1,5 **** --- 1,6 ---- Setup for (hopefully) excessive join memory use. + $ vi gendata.pl load.sql # set dump/load directory $ ./gendata.pl $ psql test < schema.sql $ psql test < load.sql --------------020302010907050201000908--