Re: Indexes and Views
Posted in 2000
Topics: General Discussion
John Shepherd wrote: > > Hi Mark > Thanks for the reply. > Appreciate the fact that views are just logical extensions of tables. Oh, okay. > What I was getting at was .... > Does Informix treat my query against (V) as 2 *separate* SELECTs vs (T) > ie SELECT #1 creates the View > & then SELECT #2 gets the actual data that the application wants ?? > > If this is the case, then Informix will be able to use 2 different indexes > as appropriate No. When you select from a view it is just the same as performing the select the view is based on. So there is only one select, one index per table. You can think of a view as a complex synonym. Cheers, -- Mark. +----------------------------------------------------------+-----------+ | Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /| | http://www.informix.com http://www.informixhandbook.com |///// / //| | http://www.iiug.org +-----------------------------------+//// / ///| | |This email will self-destruct in |/// / ////| | |10 sec. If you received this email |// / /////| | |in error, sorry about the mess. |/ ////////| +----------------------+-----------------------------------+-----------+
Great ! - Thanks Mark "Mark D. Stock" <mdstock@mydas.freeserve.co.uk> wrote in message news:8scl66$4l7$1@news.xmission.com... > > John Shepherd wrote: > > > > Hi Mark > > Thanks for the reply. > > Appreciate the fact that views are just logical extensions of tables. > > Oh, okay. > > > What I was getting at was .... > > Does Informix treat my query against (V) as 2 *separate* SELECTs vs (T) > > ie SELECT #1 creates the View > > & then SELECT #2 gets the actual data that the application wants ?? > > > > If this is the case, then Informix will be able to use 2 different indexes > > as appropriate > > No. When you select from a view it is just the same as performing the > select the view is based on. So there is only one select, one index per > table. You can think of a view as a complex synonym. > > Cheers, > -- > Mark. > > +----------------------------------------------------------+-----------+ > | Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /| > | http://www.informix.com http://www.informixhandbook.com |///// / //| > | http://www.iiug.org +-----------------------------------+//// / ///| > | |This email will self-destruct in |/// / ////| > | |10 sec. If you received this email |// / /////| > | |in error, sorry about the mess. |/ ////////| > +----------------------+-----------------------------------+-----------+