Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TbAKs-0003VR-Ce for pgsql-performance@postgresql.org; Wed, 21 Nov 2012 13:27:26 +0000 Received: from smtp.optionshouse.com ([38.98.137.6] helo=smtp.peak6.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TbAKo-0004Jp-Pz for pgsql-performance@postgresql.org; Wed, 21 Nov 2012 13:27:25 +0000 X-AuditID: 0a64cb20-b7f6b6d000003c0d-f9-50acd6b7e400 Message-ID: <50ACD6B6.1030905@optionshouse.com> Date: Wed, 21 Nov 2012 07:27:18 -0600 From: Shaun Thomas Reply-To: Organization: Peak6 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: Craig Ringer CC: Craig James , Tom Lane , Claudio Freire , Merlin Moncure , David Greco , "pgsql-performance@postgresql.org" Subject: Re: Hints (was Poor performance using CTE) References: <50AC3935.6060508@2ndQuadrant.com> In-Reply-To: <50AC3935.6060508@2ndQuadrant.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed content-transfer-encoding: 7bit X-Originating-IP: [10.10.201.64] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEKsWRmVeSWpSXmKPExsXClcIrobv92poAg+/XdCz2r9jKaNHzajqL xdLH0xktnvxqYrW40/mR0eL6zHPMFqdW3WVyYPf4ffcgk8eVnccZPXbOusvu8XR1I5PHhX3T 2D0WPdvIEsAW1cBok5iXl1+SWJKqkJJanGyr5F9QkpmfV+yRX1qcquCSWZyck5iZm1qkpJCZ YqtkrKRQkJOYnJqbmldiq5RYUJCal6Jkx6WAAWyAyjLzFFLzkvNTMvPSbZU8g/11LSxMLXUN lezikUFCJ0vGtocX2AqmsFc0tjk0MF5j7WLk5JAQMJFovLKIDcIWk7hwbz2QzcHBK6Av0XU+ HCTMIqAqMe9FC1g5m4CuxKT+FWDlQgIqEn1nbzCB2PwCwhL7PjQxg9iiAmESa/YcAovzCghK nJz5hAXEFhHQkFh54imQzcXBLNDNJLH41RSwBmEBW4n17T3MEEOLJfo+zANr5gS6oe3gDLDF zEA1F+ZcZ4Gw5SW2v50DVa8qsaJ5ItT9ChL/r7xjmsAoNAvJ7llI2mchaV/AyLyKUby4LDE5 I9O0oDi3pMBIryA1MdtMLy+1ZBMjOCGcVtjB+L3T6hCjAAejEg+vwtHVAUKsiWXFlbmHGCU4 mJVEeGMurgkQ4k1JrKxKLcqPLyrNSS0+xOgDDLSJzFKiyfnAZJVXEm9obGpgamlqaGpuamiE Q1hJnDc0dFGAkEA6MJFkp6YWpBbBjGPi4JRqYNR8NrXu3QevZWZnDv5c6hn7Xmdb8+c34Uzd J5dFdroGpC3bc0VwLefiH3qTlTp2KAk6/c45pfH3qFvCnnqObQfrHsn8frs5OMLTZZ9vQcFT XXHmz9cZfhS0Ox0wUhCc2rP6f1vRat+d1n01s+Zl3daJfJ1YWj7Vv0Iz0DE/Klwp/H+prsnb f0osxRmJhlrMRcWJAMbKUv81AwAA X-Pg-Spam-Score: -2.2 (--) X-Archive-Number: 201211/223 X-Sequence-Number: 48589 On 11/20/2012 08:15 PM, Craig Ringer wrote: > I think it's time to admit that and get the syntax in place for CTEs so > there's room to optimize them later, rather than cementing > CTEs-as-fences in forever as a Pg quirk. I know I'm just some schmo, but I'd vote for this. I'm certainly guilty of using OFFSET 0. Undocumented hints are still hints. As much as I think they're a bad idea by cementing a certain plan that may not get the benefits of future versions, non-intuitive side-effects by using overloaded syntax are worse. I've been using CTEs as temp tables because I know that's how they work. But I'd be more than willing to modify my syntax one way or the other to adopt non-materialized CTEs, provided there's some way to get the current behavior. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604 312-444-8534 sthomas@optionshouse.com ______________________________________________ See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email