MySQL Forums
Forum List  »  Performance

Re: use index on a view
Posted by: lau ch
Date: February 11, 2009 08:37PM

Hi, Rick James, thanks for your priceless suggestion. I will recofigure the mysql and re-conduct my test. looks like a long road to go for manipulating such huge records(in terms of hundreds GB records)

In addition, can you clarify me if mysql is able to perform query the desired records from every underlying table from a view with "union all" tables first and then merge them into a signle record set and return. For example, does my understanding below is true?

I have tried the "explain select * from vw_all_tables where ind_column = 123456" for all blank underlying tables, the key index column also return NULL. This circumstance is bad. When query from a view with simply "union all" tables, I expect mysql will base on the where condition to find out all desired records for each table first and then merge them into a big record set and then return. (which the way the MSSQL behaves, as it can be check from MSSQL’s execution plan)
For example, I expect mysql will based on "ind_column = 123456" to query tbl01 and get the desired records for tbl01, say, 3000 records; then mysql will based on "ind_column = 123456" to query tbl02 and get, say 3045 records, from tbl02; and so on. Finally, mysql merges all these 3000 records, 3045 records, ..., into one result set and returns to client.

Options: ReplyQuote


Subject
Views
Written By
Posted
6360
February 04, 2009 10:22PM
3116
February 05, 2009 10:26PM
2954
February 09, 2009 02:50AM
2708
February 09, 2009 11:44PM
2931
February 10, 2009 02:03AM
2600
February 11, 2009 01:21AM
Re: use index on a view
2787
February 11, 2009 08:37PM
6117
February 11, 2009 09:17PM


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.