X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A58449DCBA3 for ; Thu, 16 Feb 2006 11:31:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 19367-05 for ; Thu, 16 Feb 2006 11:31:52 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from server.gpdnet.co.uk (gpdnet.plus.com [212.56.100.243]) by postgresql.org (Postfix) with ESMTP id EE8D19DCB83 for ; Thu, 16 Feb 2006 11:31:45 -0400 (AST) Received: from www.gpdnet.co.uk (server.gpdnet.co.uk [127.0.0.1]) by server.gpdnet.co.uk (Postfix) with ESMTP id 59F473AAB50; Thu, 16 Feb 2006 15:42:36 +0000 (GMT) Received: from 84.92.210.49 (SquirrelMail authenticated user gpd) by www.gpdnet.co.uk with HTTP; Thu, 16 Feb 2006 15:42:36 -0000 (GMT) Message-ID: <4383.84.92.210.49.1140104556.squirrel@www.gpdnet.co.uk> In-Reply-To: <27898.1140100960@sss.pgh.pa.us> References: <43F38867.6010701@gpdnet.co.uk> <19510.1140036968@sss.pgh.pa.us> <19779.1140038874@sss.pgh.pa.us> <43F39E53.1020009@gpdnet.co.uk> <20781.1140046109@sss.pgh.pa.us> <43F3BF72.6000202@gpdnet.co.uk> <21152.1140049020@sss.pgh.pa.us> <21455.1140051584@sss.pgh.pa.us> <2417.84.92.210.49.1140087992.squirrel@www.gpdnet.co.uk> <27898.1140100960@sss.pgh.pa.us> Date: Thu, 16 Feb 2006 15:42:36 -0000 (GMT) Subject: Re: [HACKERS] qsort again (was Re: Strange Create Index From: "Gary Doades" To: "Tom Lane" Cc: pgsql-performance@postgresql.org Reply-To: gpd@gpdnet.co.uk User-Agent: SquirrelMail/1.4.6 [CVS]-0.cvs20050812.1.fc4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.112 required=5 tests=[AWL=0.112] X-Spam-Score: 0.112 X-Spam-Level: X-Archive-Number: 200602/250 X-Sequence-Number: 17236 > "Gary Doades" writes: >> I think the reason I wasn't seeing performance issues with normal sort >> operations is because they use work_mem not maintenance_work_mem which >> was >> only set to 2048 anyway. Does that sound right? > > Very probable. Do you want to test the theory by jacking that up? ;-) Hmm, played around a bit. I have managed to get it to do a sort on one of the "bad" columns using a select of two whole tables that results in a sequntial scan, sort and merge join. I also tried a simple select column order by column for a bad column. I tried varying maintenance_work_mem and work_mem up and down between 2048 and 65536 but I always get similar results. The sort phase always takes 4 to 5 seconds which seems about right for 900,000 rows. This was on a colunm that took 12 minutes to create an index on. I've no idea why it should behave this way, but probably explains why I (and others) may not have noticed it before. Regards, Gary.