Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X0Blw-0007yA-Di for pgsql-performance@arkaria.postgresql.org; Thu, 26 Jun 2014 15:39:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X0Blv-0008Ba-Ej for pgsql-performance@arkaria.postgresql.org; Thu, 26 Jun 2014 15:39:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X0Bln-0007yq-10 for pgsql-performance@postgresql.org; Thu, 26 Jun 2014 15:39:27 +0000 Received: from qmta08.westchester.pa.mail.comcast.net ([2001:558:fe14:43:76:96:62:80]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X0Bli-0004JP-3J for pgsql-performance@postgresql.org; Thu, 26 Jun 2014 15:39:25 +0000 Received: from omta24.westchester.pa.mail.comcast.net ([76.96.62.76]) by qmta08.westchester.pa.mail.comcast.net with comcast id K1Lm1o0021ei1Bg583fKKk; Thu, 26 Jun 2014 15:39:19 +0000 Received: from [192.168.1.172] ([98.109.148.138]) by omta24.westchester.pa.mail.comcast.net with comcast id K3ep1o00K2zPoey3k3eun4; Thu, 26 Jun 2014 15:39:14 +0000 Message-ID: <53AC3E8D.8040106@comcast.net> Date: Thu, 26 Jun 2014 11:38:53 -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: Claudio Freire CC: Shaun Thomas , "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> In-Reply-To: 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=1403797159; bh=SQtdRfBtQox/c529qbuqw1/QX5jj/P8TtbZROoYMVRE=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=h5mi0tpaBD7j9gZEX7YS9OrO66E6x77YId6XlfhHOhuQNo+KUlQDRXy5loZjATD+n zDxpFAYbwATuDAwzgRA1XdunexcrNqw5sPo+qasufOSKBl4MHoF+I08/4z9d+1lIHb wIDIOvFRNpb5aL0JcJdu794w0ozE+glzzQCTCJFm9igu1PQOr4OSqPj2xOHjphvpmR AVYGaX63o8MnlG+jnNlZctBkgHA+yGMLgN9lWV18XEk6R5SCv24BVRMy05+82c/h34 XIPVDrNUQ3zmRiCgyaKx5zFlsCkB61odGfoy3irEoI1/5Q0HdYuDcUUU8fWtYB367Y vGlJm2fWHv/4w== 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 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