Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eF3px-00067z-EQ for pgsql-performance@arkaria.postgresql.org; Wed, 15 Nov 2017 19:59:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eF3pw-0005Eg-Dc for pgsql-performance@arkaria.postgresql.org; Wed, 15 Nov 2017 19:59:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eF3pu-0005AV-Sz for pgsql-performance@postgresql.org; Wed, 15 Nov 2017 19:59:03 +0000 Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eF3ps-0000WF-02 for pgsql-performance@postgresql.org; Wed, 15 Nov 2017 19:59:01 +0000 Received: from cmgw3 (unknown [10.0.90.84]) by gproxy9.mail.unifiedlayer.com (Postfix) with ESMTP id D7FF21E0B19 for ; Wed, 15 Nov 2017 12:58:55 -0700 (MST) Received: from host214.hostmonster.com ([74.220.215.214]) by cmgw3 with id aKys1w00N4e7MuJ01Kyv9l; Wed, 15 Nov 2017 12:58:55 -0700 X-Authority-Analysis: v=2.2 cv=H76r+6Qi c=1 sm=1 tr=0 a=E7lA7DdVRVhKYBNJxJVZOg==:117 a=E7lA7DdVRVhKYBNJxJVZOg==:17 a=sC3jslCIGhcA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=hdPUlBojAAAA:8 a=ppzqssLbRwtw_-ti4hQA:9 a=QEXdDO2ut3YA:10 a=QZFWPMeDJ3QA:10 a=pGLkceISAAAA:8 a=VDVIn7cSvRQEb2ppg9IA:9 a=U5RQfKARXSXzAH8S:21 a=_W_S_7VecoQA:10 a=4SsFK_6ampoHjcc3ZJup:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gusw.net; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=lebqgx3AVyNYgDej58dT6XdhpwRkKDCAiqffdAWWBq0=; b=FRJfsPIwI+dLRM8NPpCEwu595+ wbemULAEbrZ3RxYv6PH7/jBKHk6FmtxUkew4cSaVjXR/gQ5X8fy0CAZAsPEiYDeFoblbxqjMsOepy t+oTPv/VYU4QsS8XpNJ2eS3QM; Received: from [191.7.145.23] (port=59123 helo=[192.168.9.3]) by host214.hostmonster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1eF3pe-004B2k-44 for pgsql-performance@postgresql.org; Wed, 15 Nov 2017 12:58:52 -0700 Subject: Re: query performance issue To: pgsql-performance@postgresql.org References: From: Gunther Message-ID: <31c10833-9d19-dfa5-1cab-43eaae097828@gusw.net> Date: Wed, 15 Nov 2017 14:58:17 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------B997952E9A2035454BB80F4C" Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host214.hostmonster.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gusw.net X-BWhitelist: no X-Source-IP: 191.7.145.23 X-Exim-ID: 1eF3pe-004B2k-44 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.9.3]) [191.7.145.23]:59123 X-Source-Auth: gunther+pragmaticdata.com X-Email-Count: 21 X-Source-Cap: cHJhZ21hdDE7cHJhZ21hdDE7aG9zdDIxNC5ob3N0bW9uc3Rlci5jb20= X-Local-Domain: yes 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 This is a multi-part message in MIME format. --------------B997952E9A2035454BB80F4C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 11/15/2017 8:12, Pavel Stehule wrote: > There is wrong plan due wrong estimation > > for this query you should to penalize nested loop > > set enable_nestloop to off; > > before evaluation of this query You are not the only one with this issue. May I suggest to look at this thread a little earlier this month. http://www.postgresql-archive.org/OLAP-reporting-queries-fall-into-nested-loops-over-seq-scans-or-other-horrible-planner-choices-tp5990160.html where this has been discussed in some length. regards, -Gunther --------------B997952E9A2035454BB80F4C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
On 11/15/2017 8:12, Pavel Stehule wrote:
There is wrong plan due wrong estimation

for this query you should to penalize nested loop

set enable_nestloop to off;

before evaluation of this query

You are not the only one with this issue. May I suggest to look at this thread a little earlier this month.

http://www.postgresql-archive.org/OLAP-reporting-queries-fall-into-nested-loops-over-seq-scans-or-other-horrible-planner-choices-tp5990160.html

where this has been discussed in some length.

regards,
-Gunther


--------------B997952E9A2035454BB80F4C--