MySQL Forums
Forum List  »  Newbie

Re: View runs very slow
Posted by: Phil Siyam
Date: February 18, 2021 10:01AM

Thanks Peter

I made typo, actually union is between 2 tables .

Create view tmp as
select sa.id ,sa.att_id, sa.value_desc
from msa1
join sa_con on msa.att_id = sa_con.att_id
union all

select sa.id ,sa.att_id , sa.value_desc
from msa2
join sa_tab on msa.att_id = sa_tab.att_id

I ended up creating 2 views from msa1 and msa2 and then using union in front end.

I recently started working in MYSQL, I was previously working with DB2. In DB2 if i created view like above, query optimizer will rewrite query and where clause will be executed first .

Options: ReplyQuote


Subject
Written By
Posted
January 04, 2021 12:34PM
January 04, 2021 03:20PM
Re: View runs very slow
February 18, 2021 10:01AM
February 18, 2021 10:15AM


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.