Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X0Buy-0008Kf-U4 for pgsql-performance@arkaria.postgresql.org; Thu, 26 Jun 2014 15:48:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X0Buy-0008Bh-2w for pgsql-performance@arkaria.postgresql.org; Thu, 26 Jun 2014 15:48:56 +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 1X0Bur-0007zq-V3 for pgsql-performance@postgresql.org; Thu, 26 Jun 2014 15:48:50 +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 1X0Bun-0000Uc-9j for pgsql-performance@postgresql.org; Thu, 26 Jun 2014 15:48:46 +0000 Received: from omta18.westchester.pa.mail.comcast.net ([76.96.62.90]) by qmta14.westchester.pa.mail.comcast.net with comcast id K3VY1o0031wpRvQ5E3okte; Thu, 26 Jun 2014 15:48:44 +0000 Received: from [192.168.1.172] ([98.109.148.138]) by omta18.westchester.pa.mail.comcast.net with comcast id K3oQ1o0062zPoey3e3oVdK; Thu, 26 Jun 2014 15:48:39 +0000 Message-ID: <53AC40CB.9020006@comcast.net> Date: Thu, 26 Jun 2014 11:48:27 -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: pgsql-performance@postgresql.org 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> In-Reply-To: <53AC3E8D.8040106@comcast.net> 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=1403797724; bh=Wd2W/3QkGXkNlhpv1Vl/pqgw22NkZHrVT4GJRxV2rPo=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=hSWFu+s8CrVSPVFTcjc6Aw1aRYPgR0XXefKn+lYEOCYa6+u1KtC5HmiyDwfvGnkil uZmyhDSgHlX9pC4gwoNw0YsEuW2zjLB9iTBKkRciHd9YwjMjcufYw6x54IRx+tC2xK tsDk/w9UB3o4FWSI5G+KTn1J2eIFPHS+9XbzNeF9yC4XaRJvSeH6M/ymIzMKBy+Jw7 RPI57KcSCXZi3mFj0GpJRIK6qviY1c6L/5Hn89KkSBZHaGXWSMAkiVd+iRSshSmgZ3 yCrZyhBQkT5Qodv8xUmVSRYmTRMwt2T+a1qGw+BOiAA62RzWh1HAWjUlN4pPGciXkM trEsmA4fUWgLw== 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 FWIW: I tested removing the quotes around each value, and it did not change the plan (I am a little surprised too, but I guess PG is "smarter than that"). Thanks for the idea. On 6/26/2014 11:38 AM, AJ Weber wrote: > I noticed this too. I am trying to find where the actual SQL is > generated, and I am seeing if this is an artifact of Hibernate. > > Will test the same query without the quotes as you recommend. (But I > don't know where to fix that, if it is the actual issue, unfortunately.) > > On 6/26/2014 11:35 AM, Claudio Freire wrote: >> On Thu, Jun 26, 2014 at 10:26 AM, AJ Weber wrote: >>> OK, the sample query is attached (hopefully attachments are allowed) as >>> "query.sql". >>> The "master table" definition is attached as "table1.sql". >>> The "detail table" definition is attached as "table2.sql". >>> The EXPLAIN (ANALYZE, BUFFERS) output is here: >>> http://explain.depesz.com/s/vd5 >> >> I think the problem is that you're sending strings in the ids, instead >> of integers. >> >> Remove the quotes, leave only the numbers. That will make pg able to >> infer that node.id = prop.node_id means it can also use an index on >> alf_node_properties. >> >> I think. >> >> Try. > > > -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance