List:General Discussion« Previous MessageNext Message »
From:Joerg Bruehe Date:January 18 2006 10:06am
Subject:Re: MySQL View Optimization Help
View as plain text  
Hi!

Daniel Kasak wrote:
> SGreen@stripped wrote:
> 
>> Views differ from tables in that they cannot be indexed.
>>
> I've just started experimenting with derived tables under 4.1.14, and I 
> had a hunch this was so. Is there any plan to include index support for 
> views / derived tables?

An index is a separate data structure which must be maintained when the 
base table is changed (in the indexed columns).

A view is a restricted (by rows and/or columns) look at a base table.

IMO, having separate indexes for views is not in line with the 
relational approach at all.
The way to go is an efficient use of all indexes defined on a table, 
whether it is accessed as a base table or via a view.
Any "where condition" in the view definition may be evaluated via base 
table indexes, if suitable ones are defined on the base table - provided 
the optimizer chooses this access path.

Improving the optimizer would be feature changes, so you should expect 
to see that in newer versions only.

Regards,
Joerg

-- 
Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com
Thread
MySQL View Optimization HelpScott Klarenbach7 Jan
  • Re: MySQL View Optimization HelpSGreen7 Jan
    • Re: MySQL View Optimization HelpScott Klarenbach9 Jan
    • Re: MySQL View Optimization HelpDaniel Kasak17 Jan
      • Re: MySQL View Optimization HelpJoerg Bruehe18 Jan