Received: from dune.krs.ru (dune.krs.ru [195.161.16.38]) by hub.org (8.9.1/8.9.1) with ESMTP id WAA03726 for ; Wed, 25 Nov 1998 22:27:53 -0500 (EST) (envelope-from vadim@krs.ru) Received: from krs.ru (localhost.krs.ru [127.0.0.1]) by dune.krs.ru (8.8.8/8.8.7) with ESMTP id KAA27140; Thu, 26 Nov 1998 10:27:44 +0700 (KRS) (envelope-from vadim@krs.ru) Sender: root@dune.krs.ru Message-ID: <365CCAB0.CE4B0143@krs.ru> Date: Thu, 26 Nov 1998 10:27:44 +0700 From: Vadim Mikheev Organization: OJSC Rostelecom (Krasnoyarsk) X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 2.2.6-RELEASE i386) X-Accept-Language: ru, en MIME-Version: 1.0 To: Jan Wieck CC: s-fery@kkt.sote.hu, hackers@postgreSQL.org Subject: Re: [HACKERS] Re: [SQL] cursor and update + view References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Jan Wieck wrote: > > > On the other hand, as we talk about query optimization - why > > rule system should do optimizer' work? Why not just put > > _any_ VIEW' query into FROM and let optimizer decide > > could query be rewritten as join or not? Ppl do strange > > things sometimes -:) Sometimes they use subqueries in > > WHERE while joins could be used and our optimizer don't > > try to catch this. I know that Sybase does. > > And, imho, we should implement this ... sometime -:)) > > Depends on where the optimization is done. If we do it on the > parsetree (Query struct), it's the job of the rule system. > The optimizer does not have to modify the parsetree. If it is > done on the way from the parsetree to the plan, it is the job > of the optimizer. > > If it is possible to do it on the parsetree, I would do it > there. Subquery --> Join transformation/optimization implemented in rule system will be used for Views only. Being implemented in optimizer it will be used in all cases. Vadim