Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WR5M5-0004GZ-EP for pgsql-performance@arkaria.postgresql.org; Fri, 21 Mar 2014 19:43:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WR5M4-0002Vh-QA for pgsql-performance@arkaria.postgresql.org; Fri, 21 Mar 2014 19:43:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WR5M3-0002Va-Lo for pgsql-performance@postgresql.org; Fri, 21 Mar 2014 19:43:47 +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 1WR5Lz-000368-Kv for pgsql-performance@postgresql.org; Fri, 21 Mar 2014 19:43:47 +0000 X-AuditID: 0a64cb20-f79956d000001854-bd-532c966eb0cc Message-ID: <532C966D.2080500@optionshouse.com> Date: Fri, 21 Mar 2014 14:43:41 -0500 From: Shaun Thomas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Craig James , Atri Sharma CC: Stefan Keller , Tom Lane , "pgsql-performance@postgresql.org" Subject: Re: Getting query plan alternatives from query planner? References: <15606.1395335330@sss.pgh.pa.us> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed content-transfer-encoding: 7bit X-Originating-IP: [10.10.220.56] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGIsWRmVeSWpSXmKPExsXClcIrpps3TSfY4Ek7r8WO5ptsFvtXbGW0 uD7zHLPF0S1sFqdW3WVyYPW4svM4o8fOWXfZPS7sm8busejZRpYAlqgGRpvEvLz8ksSSVIWU 1OJkWyX/gpLM/Lxij/zS4lQFl8zi5JzEzNzUIiWFzBRbJWMlhYKcxOTU3NS8ElulxIKC1LwU JTsuBQxgA1SWmaeQmpecn5KZl26r5Bnsr2thYWqpa6hkF48MEjpZMo5+Ws9Y8JWz4nJnD1MD YytHFyMnh4SAicT+m2+YIGwxiQv31rOB2LwC+hLnrlxnAbFZBFQlPk98wghiswnoSkzqXwFU w8EhKhAmseC+KkS5oMTJmU/AykUEvCS2nfsONJKLg1mgl1Fiw50n7CAJYaDEvpM7WEASQgIH mCS+/P7MCpLgFAiU6J0/B2wBs4CtxIU5EIuZBeQltr+dwwxiCwEdsaJ5IthiCQEFoENTJzAK zEKyexaS7llIuhcwMq9iFC8uS0zOyDQtKM4tKTDSK0hNzDbTy0st2cQIjtzTCjsYv3daHWIU 4GBU4uGdIKcdLMSaWFZcmXuIUYKDWUmEtzlWJ1iINyWxsiq1KD++qDQntfgQow8wbCYyS4km 5wOTSl5JvKGxqYGppamhqbmpoREOYSVx3oQSjWAhgXRgashOTS1ILYIZx8TBKdXAOK828vfP BZJ5hW/aDiz/0Z+Z9DOIKcbwZMX20A+rnMOn1gqvro58eNpC0X3Be45dF80qpE7sCTfR2iiq v4Wb0zKKd6bjrE/Xe26/MP2mk+itO7G8J2Wz6pZW13I1t4h4AxvNOWvfzND55HB037cJb7eo TrSwkVJlnRYvxb7Mb1ngTYbTqboVSizFGYmGWsxFxYkASNeJuQkDAAA= 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 03/21/2014 08:34 AM, Craig James wrote: > There have been many discussions about adding hints to Postgres over the > years. All have been firmly rejected by the Postgres developers, with > well-argued reasons. Search the archives to learn more about this topic. While that's true, and I agree with the sentiment, it could also be argued that what we have now is actually worse than hints. I've been bitten several times by wrong query plans. The cause is usually due to bad correlation estimates or edge-cases due to incomplete stats. Aside from cranking default_statistics_target up to 10,000, these issues tend to get solved through optimization fences. Reorganize a query into a CTE, or use the (gross) OFFSET 0 trick. How are these nothing other than unofficial hints? Well... they're worse, really. Hints can be deprecated, disabled in configs, or ignored in extreme cases. Optimization fences are truly forever. Unless of course they're removed. In which case, a bunch of queries that exploited them will suddenly perform a whole lot worse, causing organizations to delay upgrading PostgreSQL. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | 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