title: Predefined view vs query at runtime - mysql
body: <p>i need to know which one will be more efficient way of doing. </p>
  
  <h2>method 1: create predefined view in mysql as follows.</h2>
  
  <blockquote>
    <p>create view TestView As<br/>
    select * from Table1<br/>
    union all<br/>
    select * from Table2<br/></p>
  </blockquote>
  
  <p>after creating this view, im quering as </p>
  
  <blockquote>
    <p>select * from TestView where col_value = 5</p>
  </blockquote>
  
  <h2>method 2: im running following query at runtime</h2>
  
  <blockquote>
    <p>select * from Table1 where col_value = 5<br/>
    union all<br/>
    select * from Table2 where col_value = 5</p>
  </blockquote>
  
  <p>in first method the view can have more than 100,000 records. from which it has to find records "col_value = 5".</p>
  
  <p>Both will give me same result but i wanted to know which one is more good in performance wise.</p>