Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WzvAP-0003qa-IO for pgsql-performance@arkaria.postgresql.org; Wed, 25 Jun 2014 21:55:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WzvAO-0007yy-VB for pgsql-performance@arkaria.postgresql.org; Wed, 25 Jun 2014 21:55:45 +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 1WzvAN-0007yp-Sj for pgsql-performance@postgresql.org; Wed, 25 Jun 2014 21:55:43 +0000 Received: from smtp.optionshouse.com ([38.98.137.6] helo=smtp.peak6.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WzvAJ-0001I3-KK for pgsql-performance@postgresql.org; Wed, 25 Jun 2014 21:55:42 +0000 X-AuditID: 0a64cb20-f79426d000005a0a-23-53ab45568879 Message-ID: <53AB4551.4070207@optionshouse.com> Date: Wed, 25 Jun 2014 16:55:29 -0500 From: Shaun Thomas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Aaron Weber , "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> In-Reply-To: <1801a5d4-c3f1-4c0c-9c2c-ffb9d7f723a3@email.android.com> Content-Type: text/plain; charset="UTF-8"; format=flowed content-transfer-encoding: 7bit X-Originating-IP: [10.10.220.56] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEIsWRmVeSWpSXmKPExsXClcIrphvmujrYoHGGtcXd9ffYLa7PPMfs wOQx+fEcRo8L+6axBzBFNTDaJObl5ZcklqQqpKQWJ9sq+ReUZObnFXvklxanKrhkFifnJGbm phYpKWSm2CoZKykU5CQmp+am5pXYKiUWFKTmpSjZcSlgABugssw8hdS85PyUzLx0WyXPYH9d CwtTS11DJbt4ZJDQyZJx6fIiloJTbBVdD5cwNTBOZ+1i5OSQEDCRaLi/mg3CFpO4cG89mM0r oC+x61sjE4jNIqAqceBpOyOIzSagKzGpfwVYjahAmMTHo+ug6gUlTs58wgJiiwjkSux48RLM Fhawk5hz8yCQzcUhJNDKKPHgaxdYA6eAq0Tj8R6wI5gFLCQWvznIDmHLS2x/O4cZxBYCWryi eSJQPQfQcQpAx6VOYOSfhWTdLCTds5B0L2BkXsUoXlyWmJyRaVpQnFtSYKRXkJqYbaaXl1qy iREccacVdjB+77Q6xCjAwajEwyvAsDpYiDWxrLgy9xCjBAezkgjv+7+rgoV4UxIrq1KL8uOL SnNSiw8x+gDDYyKzlGhyPjAZ5JXEGxqbGphamhqampsaGuEQVhLnPdISFywkkA5MAdmpqQWp RTDjmDg4pRoYLY/bTZiz6/VEjm0RMyUWZTauv6moGu+/mZfZY3t1ixjLv7KH54qcP8w7JOZ2 ZPPUBxt6z+e0VWnvd2MM+v7Vu8fd8qL8bJcbc8oNVz3ewPckQiHd9dUjloqMoLYzdSmm59l1 nzyz+iCff2q/75Um30tJOgeUJi69YtmbdDSubHvuVOUdXv8+KbEUZyQaajEXFScCAPQemqPl AgAA X-Pg-Spam-Score: -1.9 (-) 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 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 -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance