title: How to optimize the below query?
body: <p>I have one table that table has more than 70 million row. If i execute this query it is taking approximately 1581 secs to complete. How to optimize this query? moreover that table is log table. That table do not have any index. Any suggestion? </p>
  
  <pre><code>select a.volumeOfUser_Show_Psg, b.volumeOfUser_Continue_Psg, (a.volumeOfUser_Show_Psg - b.volumeOfUser_Continue_Psg) as totalNumberCancleProgressSaver
  from
  (select Count(R_CRE_ID) as volumeOfUser_Show_Psg from CADT where CUR_REC like 'Show_Progress_Saver%'
  and CAST(R_CRE_TIME AS DATE) &gt;= @fromDate and CAST(R_CRE_TIME AS DATE) &lt;= @toDate) a,
  (select Count(R_CRE_ID) as volumeOfUser_Continue_Psg from CADT where CUR_REC like 'Continue_Progress_Saver%'
  and CAST(R_CRE_TIME AS DATE) &gt;= @fromDate and CAST(R_CRE_TIME AS DATE) &lt;= @toDate) b;
  </code></pre>