Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eAYJL-0007RM-Uv for pgsql-performance@arkaria.postgresql.org; Fri, 03 Nov 2017 09:30:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eAYJK-0007V9-KS for pgsql-performance@arkaria.postgresql.org; Fri, 03 Nov 2017 09:30:46 +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 1eAYHY-0004Kd-Uv for pgsql-performance@postgresql.org; Fri, 03 Nov 2017 09:28:57 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eAYHR-0008Ke-Ck for pgsql-performance@postgresql.org; Fri, 03 Nov 2017 09:28:55 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id DF5E093BC4E9 for ; Fri, 3 Nov 2017 02:28:47 -0700 (MST) Date: Fri, 3 Nov 2017 02:28:47 -0700 (MST) From: Thomas Kellerer To: pgsql-performance@postgresql.org Message-ID: <1509701327868-0.post@n3.nabble.com> In-Reply-To: <1509611428.3268.5.camel@cybertec.at> References: <1509611428.3268.5.camel@cybertec.at> Subject: Re: OLAP/reporting queries fall into nested loops over seq scans or other horrible planner choices MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Laurenz Albe schrieb am 02.11.2017 um 09:30: > Finally, even though the official line of PostgreSQL is to *not* have > query hints, and for a number of good reasons, this is far from being > an unanimous decision. The scales may tip at some point, though I > personally hope that this point is not too close. I also think that hints are not the right way to solve problems like that. I do like Oracle's approach with SQL profiles, where you can force the optimizer to try harder to find a good execution plan. I _think_ it even runs the statement with multiple plans and compares the expected outcome with the actual values. Once a better plan is found that plan can be attached to that query and the planner will use that plan with subsequent executions. This however requires a much bigger infrastructure then simple hints. (Unrelated, but: maybe a compromise of the never-ending "hints vs. no hints" discussion would be, to think about integrating the existing "pg_hint_plan" as a standard contrib module) Thomas -- Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance