Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wzvho-0005WG-D2 for pgsql-performance@arkaria.postgresql.org; Wed, 25 Jun 2014 22:30:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wzvhn-0005qK-Oy for pgsql-performance@arkaria.postgresql.org; Wed, 25 Jun 2014 22:30:15 +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 1Wzvhm-0005p5-Dn for pgsql-performance@postgresql.org; Wed, 25 Jun 2014 22:30:14 +0000 Received: from qmta01.westchester.pa.mail.comcast.net ([2001:558:fe14:43:76:96:62:16]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wzvhi-0006V4-KX for pgsql-performance@postgresql.org; Wed, 25 Jun 2014 22:30:12 +0000 Received: from omta02.westchester.pa.mail.comcast.net ([76.96.62.19]) by qmta01.westchester.pa.mail.comcast.net with comcast id Jm6J1o0060QuhwU51mW9cu; Wed, 25 Jun 2014 22:30:09 +0000 Received: from android-19bb4f85b0fc4b16.webtek-llc.com ([98.109.148.138]) by omta02.westchester.pa.mail.comcast.net with comcast id JmVk1o0052zPoey3NmVpn2; Wed, 25 Jun 2014 22:30:04 +0000 User-Agent: K-9 Mail for Android In-Reply-To: <53AB4551.4070207@optionshouse.com> References: <53AB2CB1.8080201@comcast.net> <53AB35CC.10202@optionshouse.com> <1801a5d4-c3f1-4c0c-9c2c-ffb9d7f723a3@email.android.com> <53AB4551.4070207@optionshouse.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----8LEEMQB8Z695TLTIYKZ3455DYUTLLQ" Content-Transfer-Encoding: 8bit Subject: Re: how to improve perf of 131MM row table? From: Aaron Weber Date: Wed, 25 Jun 2014 18:29:40 -0400 To: Shaun Thomas , "pgsql-performance@postgresql.org" Message-ID: <05c5e35e-3cd8-4ff7-bb65-ef0df61b345c@email.android.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1403735409; bh=/ApAZw5F0YJjb0T1IirwUu1dsY5rnCTtivKeBSdSRlU=; h=Received:Received:MIME-Version:Content-Type:Subject:From:Date:To: Message-ID; b=jcoEfNKZzqQ6t2dIxjrkqnuzAckw+TMmmGksDNav0t1M6ZCt7pwplNWOVd06WLWPa e8kz4RP8iZoW9RGE5Y+DPmk4EE2Wsc6UbqKXtyYoCB94E6SR1hmiD9KnboG6GwrCL2 axX3ALCQeSHYpKiV5FgujW3SsIaOvjTIuyNf7B4NcGMJaw7lUwDMnONwYoz2jABWAf GzSSlfw3YqzAmLNsJZkOzZ2+ZSnkTdvOuC2BANLtW8yOxrgMdGTkgVIgPl8n9s1T+0 H4lf6q8c0NA+fZRSmyFCuqTmUYa+Q8OGz5MgZN9FuqFReQj/UGfuvJtfNfPJgVcCKQ jtrlmEIg0pe0g== 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 ------8LEEMQB8Z695TLTIYKZ3455DYUTLLQ Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Will get what you asked for ASAP. Thanks for your time. -- Aaron On June 25, 2014 5:55:29 PM EDT, Shaun Thomas wrote: >On 06/25/2014 04:40 PM, Aaron Weber wrote: > >> In the meantime, I guess I wasn't clear about some other particulars >> The query's where clause is only an "IN", with a list of id's (those >> I mentioned are the PK), and the join is explicitly on the PK (so, >> indexed). > >Indexed doesn't mean indexed if the wrong datatypes are used. We need >to >see the table and index definitions, and a sample query with EXPLAIN >ANALYZE output. > >> An IN with 50 int values took 23sec to return (by way of example). > >To me, this sounds like a sequence scan, or one of your key matches so >many rows, the random seeks are throwing off your performance. Of >course, I can't confirm that without EXPLAIN output. > >-- >Shaun Thomas >OptionsHouse, LLC | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, >60604 >312-676-8870 >sthomas@optionshouse.com > >______________________________________________ > >See http://www.peak6.com/email_disclaimer/ for terms and conditions >related to this email ------8LEEMQB8Z695TLTIYKZ3455DYUTLLQ Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Will get what you asked for ASAP. Thanks for your time.
--
Aaron

On June 25, 2014 5:55:29 PM EDT, Shaun Thomas <sthomas@optionshouse.com> wrote:
On 06/25/2014 04:40 PM, Aaron Weber wrote:

In the meantime, I guess I wasn't clear about some other particulars
The query's where clause is only an "IN", with a list of id's (those
I mentioned are the PK), and the join is explicitly on the PK (so,
indexed).

Indexed doesn't mean indexed if the wrong datatypes are used. We need to
see the table and index definitions, and a sample query with EXPLAIN
ANALYZE output.

An IN with 50 int values took 23sec to return (by way of example).

To me, this sounds like a sequence scan, or one of your key matches so
many rows, the random seeks are throwing off your performance. Of
course, I can't confirm that without EXPLAIN output.
------8LEEMQB8Z695TLTIYKZ3455DYUTLLQ--