Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UfOoA-0004Zh-KF for pgsql-performance@arkaria.postgresql.org; Thu, 23 May 2013 06:15:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UfOoA-0007PI-3V for pgsql-performance@arkaria.postgresql.org; Thu, 23 May 2013 06:15:26 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UfOo8-0007O6-FZ for pgsql-performance@postgresql.org; Thu, 23 May 2013 06:15:24 +0000 Received: from szxga01-in.huawei.com ([119.145.14.64]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UfOnx-0006et-4X for pgsql-performance@postgresql.org; Thu, 23 May 2013 06:15:23 +0000 Received: from 172.24.2.119 (EHLO szxeml210-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BCO40908; Thu, 23 May 2013 14:14:55 +0800 (CST) Received: from SZXEML449-HUB.china.huawei.com (10.82.67.192) by szxeml210-edg.china.huawei.com (172.24.2.183) with Microsoft SMTP Server (TLS) id 14.1.323.7; Thu, 23 May 2013 14:13:45 +0800 Received: from blrprnc09ns (10.18.96.98) by szxeml449-hub.china.huawei.com (10.82.67.192) with Microsoft SMTP Server id 14.1.323.7; Thu, 23 May 2013 14:13:47 +0800 From: Amit Kapila To: CC: References: <20130522093304.5a830134ae84016b0174832fdc1a3173.018dc1af79.wbe@email11.secureserver.net> In-Reply-To: <20130522093304.5a830134ae84016b0174832fdc1a3173.018dc1af79.wbe@email11.secureserver.net> Subject: Re: Very slow inner join query Unacceptable latency. Date: Thu, 23 May 2013 11:43:44 +0530 Message-ID: <003d01ce577c$af6535d0$0e2fa170$@kapila@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac5XCgoJzglTJl+PTm2y7HDHabuSRwAcTZfQ Content-Language: en-us x-cr-hashedpuzzle: BG90 Cwkq Ed+5 E2F5 GKod GOeO HVof ITA3 I47f K6/9 LzkP NDh9 Nx8/ SiiF TFZd TWOn; 2; ZgBiAHUAcgBnAGUAcwBzAEAAcgBhAGQAaQBhAG4AdABiAGwAdQBlAC4AYwBvAG0AOwBwAGcAcwBxAGwALQBwAGUAcgBmAG8AcgBtAGEAbgBjAGUAQABwAG8AcwB0AGcAcgBlAHMAcQBsAC4AbwByAGcA; Sosha1_v1; 7; {A1DE451F-AECB-4684-AA44-273732424823}; YQBtAGkAdAAuAGsAYQBwAGkAbABhAEAAaAB1AGEAdwBlAGkALgBjAG8AbQA=; Thu, 23 May 2013 06:13:39 GMT; UgBFADoAIABbAFAARQBSAEYATwBSAE0AXQAgAFYAZQByAHkAIABzAGwAbwB3ACAAaQBuAG4AZQByACAAagBvAGkAbgAgAHEAdQBlAHIAeQAgAFUAbgBhAGMAYwBlAHAAdABhAGIAbABlACAAbABhAHQAZQBuAGMAeQAuAA== x-cr-puzzleid: {A1DE451F-AECB-4684-AA44-273732424823} X-Originating-IP: [10.18.96.98] X-CFilter-Loop: Reflected X-Pg-Spam-Score: 0.7 (/) 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 Wednesday, May 22, 2013 10:03 PM fburgess wrote: > I did perform a explain analyze on the query. Explain analyze doesn't help to collect statistics. You should use Analyze = . Ideally optimizer should have slected the best plan, but just to check you = can once try with SET enable_hashjoin=3Doff; And see what is the plan it chooses and does it pick up index scan on large= r table? Could you please output of \d SARS_ACTS and \d SARS_ACTS_RUN? With Regards, Amit Kapila. --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance