Bug #11716 | Extremely poor performance when joining tables and views | ||
---|---|---|---|
Submitted: | 4 Jul 2005 2:48 | Modified: | 19 Aug 2005 8:41 |
Reporter: | [ name withheld ] | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.0.7 beta max | OS: | Linux (Linux (FC 4)) |
Assigned to: | Evgeny Potemkin | CPU Architecture: | Any |
[4 Jul 2005 2:48]
[ name withheld ]
[4 Jul 2005 12:13]
MySQL Verification Team
Yes please provide for us the tables with their data, views and queries. You can upload a zipped file at: ftp://ftp.mysql.com/pub/mysql/upload/ Please use a file name which identifies this number report. Thanks in advance.
[6 Jul 2005 1:05]
[ name withheld ]
I have uploaded a zip file called id_11716.zip to ftp.mysql.com/pub/mysql/upload/ This zip file contains three files - warrantee.sql - a backup file of the database in question produced by mysql admin - rep_query.sql - the query that produces the list of reps in approximately 0.05 seconds - views.sql - several view creation queries that produce the required views In order to test this - create the database by running warrantee.sql - create the views by running views.sql - run the query contained in the file rep_query.sql - run the query "select * from re_view_01" Please note that the query in the file rep_query.sql is the same query as the view rep_view_01 except that instead of using the views phone_view_01, fax_view_01 and postal_address_view_01 I inserted these queries as subqueries into the query in rep_query.sql (I hope this makes sense). Thank you. Reginald Oake
[6 Jul 2005 1:08]
[ name withheld ]
Correction to previous comment... The line that reads - run the query "select * from re_view_01" should actually be - run the query "select * from rep_view_01"
[10 Aug 2005 15:19]
Ken Johanson
Dear [name withheld], Do you think this might be related to bug?: http://bugs.mysql.com/bug.php?id=11945
[19 Aug 2005 8:41]
Evgeny Potemkin
When it's not set explicitly view is created with default algorithm. But it is not optimal in this case. Views which you use to replace subselects better to create with ALGORITHM=TEMPTABLE. For example "create or replace algorithm=temptable view phone_view_01 as select ... " See also http://dev.mysql.com/doc/mysql/en/create-view.html
[19 Aug 2005 16:05]
[ name withheld ]
Thank you very much. This was very helpful.