MySQL Forums
Forum List  »  Performance

use index on a view
Posted by: lau ch
Date: February 04, 2009 10:22PM

How to use index on a view that just union all some tables?

for example, can I write this:

select * from vw_all_tables use index (col_name) where col_name > 1000;

What I want to do is that:
I have 20 tables and each has 20M records. I create the view "vw_all_tables" to just union all these 20 tables. when i run the above query, the mysql eats all memory(98.9% from top) and cause the Linux OS to almost down. This circumstance is repeatable.

thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
use index on a view
4571
February 04, 2009 10:22PM
2558
February 05, 2009 10:26PM
2440
February 09, 2009 02:50AM
2280
February 09, 2009 11:44PM
2471
February 10, 2009 02:03AM
2177
February 11, 2009 01:21AM
2349
February 11, 2009 08:37PM
5558
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.