Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A128D9FB1DC; Thu, 12 Oct 2006 12:42:37 -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 62493-05; Thu, 12 Oct 2006 12:42:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id D5C659FB2D9; Thu, 12 Oct 2006 12:42:33 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k9CFgW0c010867; Thu, 12 Oct 2006 11:42:32 -0400 (EDT) To: "Jim C. Nasby" cc: pgsql-performance@postgresql.org, pgsql-hackers@postgresql.org Reply-To: pgsql-hackers@postgresql.org Subject: Re: Hints proposal In-reply-to: <20061012151439.GT28647@nasby.net> References: <20061012151439.GT28647@nasby.net> Comments: In-reply-to "Jim C. Nasby" message dated "Thu, 12 Oct 2006 10:14:39 -0500" Date: Thu, 12 Oct 2006 11:42:32 -0400 Message-ID: <10866.1160667752@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.09 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/236 X-Sequence-Number: 21365 [ This is off-topic for -performance, please continue the thread in -hackers ] "Jim C. Nasby" writes: > 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. > It would also be useful to allow tweaking of planner cost estimates. > This would take the general form of > node operator value This is at least focusing on the right sort of thing, although I still find it completely misguided to be attaching hints like this to individual queries. What I would like to see is information *stored in a system catalog* that affects the planner's cost estimates. As an example, the DBA might know that a particular table is touched sufficiently often that it's likely to remain RAM-resident, in which case reducing the page fetch cost estimates for just that table would make sense. (BTW, this is something the planner could in principle know, but we're unlikely to do it anytime soon, for a number of reasons including a desire for plan stability.) The other general category of thing I think we need is a way to override selectivity estimates for particular forms of WHERE clauses. regards, tom lane