performance - MySql view is slow comparatively to their base query -


i have created view in mysql

create view vtax select * table1  union select * table2; 

where in table 1 have 800000 records, , table2 have 500000 records, when run independent queries result returned 0.078 secs, when running them through view goes in toss taking time more 10-15 secs.

select * vtax col1=value; -- takes more 10-15 secs  select * table1 col1=value; -- takes 0.078 secs  select * table2 col1=value; -- takes 0.078 secs 

i have created indexes on tables separately.

any help/idea should done.

union

performs distinct on results (often sort). can use

union all

? (ie. rows distinct?)


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -