Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 73FB69FB3A7 for ; Tue, 10 Oct 2006 23:38:35 -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 05694-10 for ; Wed, 11 Oct 2006 02:38:31 +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 3DAE59FB35A for ; Tue, 10 Oct 2006 23:38:30 -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 k9B2cT1K015662; Tue, 10 Oct 2006 22:38:29 -0400 (EDT) To: Brian Herlihy cc: Postgresql Performance Subject: Re: Simple join optimized badly? In-reply-to: <20061011012202.76392.qmail@web52303.mail.yahoo.com> References: <20061011012202.76392.qmail@web52303.mail.yahoo.com> Comments: In-reply-to Brian Herlihy message dated "Wed, 11 Oct 2006 11:22:02 +1000" Date: Tue, 10 Oct 2006 22:38:29 -0400 Message-ID: <15661.1160534309@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/217 X-Sequence-Number: 21346 Brian Herlihy writes: > What would it take for hints to be added to postgres? A *whole lot* more thought and effort than has been expended on the subject to date. Personally I have no use for the idea of "force the planner to do exactly X given a query of exactly Y". You don't have exactly Y today, tomorrow, and the day after (if you do, you don't need a hint mechanism at all, you need a mysql-style query cache). IMHO most of the planner mistakes we see that could be fixed via hinting are really statistical estimation errors, and so the right level to be fixing them at is hints about how to estimate the number of rows produced for given conditions. Mind you that's still a plenty hard problem, but you could at least hope that a hint of that form would be useful for more than one query. regards, tom lane