Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X0Dzr-0005Yn-Ah for pgsql-performance@arkaria.postgresql.org; Thu, 26 Jun 2014 18:02:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X0Dzq-0000l5-RQ for pgsql-performance@arkaria.postgresql.org; Thu, 26 Jun 2014 18:02:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X0Dzp-0000kl-EP for pgsql-performance@postgresql.org; Thu, 26 Jun 2014 18:02:05 +0000 Received: from qmta14.westchester.pa.mail.comcast.net ([2001:558:fe14:44:76:96:59:212]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X0Dzh-00031w-P7 for pgsql-performance@postgresql.org; Thu, 26 Jun 2014 18:02:03 +0000 Received: from omta02.westchester.pa.mail.comcast.net ([76.96.62.19]) by qmta14.westchester.pa.mail.comcast.net with comcast id K3g81o0040QuhwU5E61v9n; Thu, 26 Jun 2014 18:01:55 +0000 Received: from [192.168.1.172] ([68.37.13.70]) by omta02.westchester.pa.mail.comcast.net with comcast id K61v1o00Y1Wh2x83N61vYl; Thu, 26 Jun 2014 18:01:55 +0000 Message-ID: <53AC6017.5010307@comcast.net> Date: Thu, 26 Jun 2014 14:01:59 -0400 From: AJ Weber User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Shaun Thomas , Claudio Freire CC: postgres performance list Subject: Re: how to improve perf of 131MM row table? References: <53AB2CB1.8080201@comcast.net> <53AB35CC.10202@optionshouse.com> <1801a5d4-c3f1-4c0c-9c2c-ffb9d7f723a3@email.android.com> <53AB4551.4070207@optionshouse.com> <53AC1F6E.4000700@comcast.net> <53AC3E8D.8040106@comcast.net> <53AC40CB.9020006@comcast.net> <53AC491A.8090207@optionshouse.com> In-Reply-To: <53AC491A.8090207@optionshouse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1403805715; bh=iCmdOFORHwk5uhjvFqr5Gd93CUg6vbjKm5vR1p1yvUY=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=j82Phw0qZwP5gvvar74k5aQ6Uurhf3sD5mkLsFha9ZFBTVEgWRwgTBPaPWCS+C4WH yxQVuOr64kA0zbPo7nJeItQsbovh9C3RhcPQxLKe/1xEkEVjfse6CwN1HUsom39JMS vw3kCD2Xb34wtS+ii7/NO84oaRd+GxJrJ6hLihKntTQ5If9hWH8jUHykOAZRjj6wFO KUfJ1zWdPsOZw8w/ugN8w9tglGtHII6VHgQIEtaET5XCb6hnCeP97liok95vRi/G/Q Cz1X3a153oM6XpLNrwO264M/hJHSg6V//B0TTXZyivpvuWxsxh5q18GwkvD2EG5X7F QijiRDfUi+IvQ== X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 6/26/2014 12:23 PM, Shaun Thomas wrote: > On 06/26/2014 11:19 AM, Claudio Freire wrote: > >> Try changing node_id in (...) into node.id in (...) > That looks much better to my untrained eye! (Am I right?) Nested Loop (cost=218.29..21305.47 rows=53480 width=187) (actual time=42.347.. 43.617 rows=1071 loops=1) Buffers: shared hit=487 read=15 -> Bitmap Heap Scan on alf_node node (cost=218.29..423.40 rows=51 width=16) (actual time=42.334..42.413 rows=51 loops=1) Recheck Cond: (id = ANY ('{175769,175771,175781,175825,175881,175893,17 5919,175932,175963,175999,176022,176079,176099,176115,176118,176171,176181,17621 7,176220,176243,176283,176312,176326,176335,176377,176441,176444,176475,176530,1 76570,176623,176674,176701,176730,176748,176763,176771,176808,176836,176851,1768 64,176881,176929,176945,176947,176960,177006,177039,177079,177131,177144}'::bigi nt[])) Buffers: shared hit=159 read=15 -> Bitmap Index Scan on alf_node_pkey (cost=0.00..218.28 rows=51 widt h=0) (actual time=42.326..42.326 rows=51 loops=1) Index Cond: (id = ANY ('{175769,175771,175781,175825,175881,17589 3,175919,175932,175963,175999,176022,176079,176099,176115,176118,176171,176181,1 76217,176220,176243,176283,176312,176326,176335,176377,176441,176444,176475,1765 30,176570,176623,176674,176701,176730,176748,176763,176771,176808,176836,176851, 176864,176881,176929,176945,176947,176960,177006,177039,177079,177131,177144}':: bigint[])) Buffers: shared hit=146 read=7 -> Index Scan using fk_alf_nprop_n on alf_node_properties prop (cost=0.00.. 396.34 rows=1049 width=179) (actual time=0.006..0.013 rows=21 loops=51) Index Cond: (prop.node_id = node.id) Buffers: shared hit=328 Total runtime: 43.747 ms AM I RIGHT? (That it's much better -- I thank Claudio and Shaun for being right!) -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance