Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E19309FB399; Thu, 12 Oct 2006 13:41:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 74848-03; Thu, 12 Oct 2006 13:41:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from outmail128167.authsmtp.co.uk (outmail128167.authsmtp.co.uk [62.13.128.167]) by postgresql.org (Postfix) with ESMTP id 6CB369FB2F8; Thu, 12 Oct 2006 13:41:20 -0300 (ADT) Received: from [192.168.1.140] (dsl081-245-111.sfo1.dsl.speakeasy.net [64.81.245.111]) (authenticated bits=0) by mail.authsmtp.com (8.13.6/8.13.6/Kp) with ESMTP id k9CGexBI036637; Thu, 12 Oct 2006 17:41:00 +0100 (BST) Message-ID: <452E6FFE.7010504@agliodbs.com> Date: Thu, 12 Oct 2006 09:40:30 -0700 From: Josh Berkus User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: "Jim C. Nasby" CC: pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org Subject: Re: [HACKERS] Hints proposal References: <20061012151439.GT28647@nasby.net> <10866.1160667752@sss.pgh.pa.us> <20061012162525.GF28647@nasby.net> In-Reply-To: <20061012162525.GF28647@nasby.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Server-Quench: 7201aa57-5a10-11db-b1d3-001185d377ca X-AuthRoute: OCdyZgscClZXSx8a IioLCC5HRQ8+YBZL BAkGMA9GIUINWEQK c1ADdB10O0FbHwkB BXYKXF5QUVdxWC1z bxRZbBtfZk9QXgRr T0pMQFdNFEszCG92 U1ZsKxlxcQNFfzBy YkRlEHdZXEUrJEN6 X0sFFG0bZGY0On1N URRbagNUcQJCe0tG bVcsBT1vNG8XDQIR NCweBQsEdQZnBR57 ZTsoGBoyQEAXBXYk XRcaGi4mGSVf X-Authentic-SMTP: 61633136333939.squirrel.dmpriest.net.uk:199/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.043 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/244 X-Sequence-Number: 21373 Jim, >>> These hints would outright force the planner to do things a certain way. >>> ... FROM table /* ACCESS {SEQSCAN | [[NO] BITMAP] INDEX index_name} */ >> This proposal seems to deliberately ignore every point that has been >> made *against* doing things that way. It doesn't separate the hints >> from the queries, it doesn't focus on fixing the statistical or cost >> misestimates that are at the heart of the issue, and it takes no account >> of the problem of hints being obsoleted by system improvements. > > Yes, but it does one key thing: allows DBAs to fix problems *NOW*. See > also my comment below. I don't see how adding extra tags to queries is easier to implement than an ability to modify the system catalogs. Quite the opposite, really. And, as I said, if you're going to push for a feature that will be obsolesced in one version, then you're going to have a really rocky row to hoe. > Yes, but as I mentioned the idea here was to come up with something that > is (hopefully) easy to define and implement. In other words, something > that should be doable for 8.3. Because this proposal essentially amounts > to limiting plans the planner will consider and tweaking it's cost > estimates, I'm hoping that it should be (relatively) easy to implement. Even I, the chief marketing geek, am more concerned with getting a feature that we will still be proud of in 5 years than getting one in the next nine months. Keep your pants on! I actually think the way to attack this issue is to discuss the kinds of errors the planner makes, and what tweaks we could do to correct them. Here's the ones I'm aware of: -- Incorrect selectivity of WHERE clause -- Incorrect selectivity of JOIN -- Wrong estimate of rows returned from SRF -- Incorrect cost estimate for index use Can you think of any others? I also feel that a tenet of the design of the "planner tweaks" system ought to be that the tweaks are collectible and analyzable in some form. This would allow DBAs to mail in their tweaks to -performance or -hackers, and then allow us to continue improving the planner. --Josh Berkus