Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id D5E799FA4F0 for ; Tue, 10 Oct 2006 11:00:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 14749-05 for ; Tue, 10 Oct 2006 14:00:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id C09409FA376 for ; Tue, 10 Oct 2006 11:00:52 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id D794E56431; Tue, 10 Oct 2006 09:00:51 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Tue, 10 Oct 2006 09:00:50 -0500 Date: Tue, 10 Oct 2006 09:00:50 -0500 From: "Jim C. Nasby" To: Tom Lane Cc: Tobias Brox , Chris Browne , pgsql-performance@postgresql.org Subject: Re: Simple join optimized badly? Message-ID: <20061010140050.GZ72517@nasby.net> References: <20061009213303.GA19144@oppetid.no> <20061009223030.GW72517@nasby.net> <9723.1160433916@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9723.1160433916@sss.pgh.pa.us> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:061010:tgl@sss.pgh.pa.us::kw8FxN2aKWevTNSu:00000000000000000000 0000000000000000000000009JOd X-Hashcash: 1:20:061010:tobias@nordicbet.com::uFbHJ7XJDwpGMcFJ:00000000000000000 0000000000000000000000001ZRm X-Hashcash: 1:20:061010:cbbrowne@acm.org::16MV2KqHQ53K1pjn:018cN X-Hashcash: 1:20:061010:pgsql-performance@postgresql.org::Z/z8opWYjGjSWP82:00000 0000000000000000000000001KZp X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/181 X-Sequence-Number: 21310 On Mon, Oct 09, 2006 at 06:45:16PM -0400, Tom Lane wrote: > "Jim C. Nasby" writes: > > One of the big problems with doing set enable_...=off is that there's no > > way to embed that into something like a view, so you're almost forced > > into putting into the application code itself, which makes matters even > > worse. If you could hint this within a query (maybe even on a per-table > > level), you could at least encapsulate that into a view. > > You've almost reinvented one of the points that was made in the last > go-round on the subject of hints, which is that keeping them out of the > application code is an important factor in making them manageable by a > DBA. Hints stored in a system catalog (and probably having the form of > "make this statistical assumption" rather than specifically "use that > plan") would avoid many of the negatives. Sure, but IIRC no one's figured out what that would actually look like, while it's not hard to come up with a syntax that allows you to tell the optimizer "scan index XYZ to access this table". (And if there's real interest in adding that I'll come up with a proposal.) I'd rather have the ugly solution sooner rather than the elegant one later (if ever). -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)