MySQL Forums
Forum List  »  Performance

Performance of Views
Posted by: Scott Sosna
Date: August 15, 2005 05:44PM

Has anyone done much performance testing or tuning with views? I have a query which joins four tables. When I explain the query directly (SELECT a, b, c, d FROM tab1, tab2...), the time is very good. When I explain the query through the view (SELECT * FROM view), the time goes up to 4 seconds. The query plans on each are fairly similar, except that the view's plan uses DERIVED instead of the four SIMPLE's I get with the query directly. I have tried multiple ways of writing the JOINs, I have explicitly specified an algorithm, I have different table types (MyISAM and InnoDB). No substantial difference occurs.

With most databases, my experience has been that views perform like the underlying query because the query parser is just inserting the SQL of the view (especially when you just selecting from the view). However, that doesn't seem to be the case here. I am trying to convert an application from Oracle to MySQL which relies on views, so this is very important.

TIA.
-scs

Options: ReplyQuote


Subject
Views
Written By
Posted
Performance of Views
3105
August 15, 2005 05:44PM
1711
August 16, 2005 03:11AM
1618
August 16, 2005 04:32PM
1734
August 18, 2005 05:26AM
1767
August 18, 2005 08:12PM
1738
August 19, 2005 03:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.