Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 7CE679FB2B8 for ; Mon, 9 Oct 2006 19:45:30 -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 34184-07 for ; Mon, 9 Oct 2006 22:45:21 +0000 (UTC) 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 846E09FB2AB for ; Mon, 9 Oct 2006 19:45:21 -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 k99MjGqk009724; Mon, 9 Oct 2006 18:45:16 -0400 (EDT) To: "Jim C. Nasby" cc: Tobias Brox , Chris Browne , pgsql-performance@postgresql.org Subject: Re: Simple join optimized badly? In-reply-to: <20061009223030.GW72517@nasby.net> References: <20061009213303.GA19144@oppetid.no> <20061009223030.GW72517@nasby.net> Comments: In-reply-to "Jim C. Nasby" message dated "Mon, 09 Oct 2006 17:30:31 -0500" Date: Mon, 09 Oct 2006 18:45:16 -0400 Message-ID: <9723.1160433916@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/175 X-Sequence-Number: 21304 "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. regards, tom lane