MySQL Forums :: Performance :: use index on a view


Advanced Search

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 4356 lau ch 02/04/2009 10:22PM
Re: use index on a view 2485 Rick James 02/05/2009 10:26PM
Re: use index on a view 2374 lau ch 02/09/2009 02:50AM
Re: use index on a view 2220 Rick James 02/09/2009 11:44PM
Re: use index on a view 2397 lau ch 02/10/2009 02:03AM
Re: use index on a view 2121 Rick James 02/11/2009 01:21AM
Re: use index on a view 2306 lau ch 02/11/2009 08:37PM
Re: use index on a view 5494 Rick James 02/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.