Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id D3FDC53A7E6 for ; Mon, 2 Jan 2012 07:45:07 -0400 (AST) Received: from rsx35.justhost.com ([184.154.21.218]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RhgK6-00041k-Gq for pgsql-performance@postgresql.org; Mon, 02 Jan 2012 11:45:06 +0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=tactis.pt; h=Received:Message-ID:Disposition-Notification-To:Date:From:Reply-To:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Source:X-Source-Args:X-Source-Dir; b=lUSMawlSEDg1nzD8NyYC0OaEeYMXNtXfopNmZhvsLRAcjZ9NrgN9ErUYzJJXPPbRPPG+ZzzDZ+YKgGAskb9NABZ/3VT5aQuQheRsplj422HiJzRTYSJBetwT7Yz+RYPT; Received: from 195-23-29-173.static.net.novis.pt ([195.23.29.173] helo=[192.168.70.15]) by rsx35.justhost.com with esmtpa (Exim 4.69) (envelope-from ) id 1RhgJs-0005mC-OP; Mon, 02 Jan 2012 05:44:48 -0600 Message-ID: <4F0198AB.6030405@tactis.pt> Date: Mon, 02 Jan 2012 11:44:43 +0000 From: Miguel Silva Reply-To: miguel.silva@tactis.pt Organization: TACTIS , LDA User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Merlin Moncure CC: pgsql-performance@postgresql.org Subject: Re: Query performance - normal on 9.0.4, slow from 9.0.5 onwards References: <4EFDE928.50807@tactis.pt> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - rsx35.justhost.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tactis.pt X-Source: X-Source-Args: X-Source-Dir: X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/3 X-Sequence-Number: 46016 On 30-12-2011 19:35, Merlin Moncure wrote: > try this (curious): > create table pos as select n from generate_series(1,32) n; > > and swap that for the in-query generate series call. your statistics > in the query are completely off (not 100% sure why), so I'm thinking > to replace that since it lies to the planner about the # rows > returned. also the join on the array element probably isn't helping. > > merlin > Tried it. The query still takes around the same amount of time but, out of curiosity, here's the explain analyze of it: http://explain.depesz.com/s/MvE .