title: Performance improvement. Order by creating trouble
body: <p>I am trying to improve performance of this query from last 10 days but its not working. Mainly the <code>order by</code> clause is taking time to execute because removing that when i executed the query it took some seconds but if order by is included then its taking more than 5 mins. Below is the query-</p>
  
  <pre><code>Select a.user_vchr_char2, 
         a.voucher_id, 
         a.uap_clm_pymnt_stat, 
         a.pymnt_id_ref, 
         to_char(cast(a.lastupddttm as timestamp), 'YYYY-MM-DD-HH24.MI.SS.'),   
         to_char(a.pymnt_dt,'YYYY-MM-DD'),to_char(a.cancel_dt,'YYYY-MM-DD'),   
         to_char(a.scheduled_pay_dt,'YYYY-MM-DD'), to_char(a.transaction_date,'YYYY-MM-DD'),         
         a.descr254_mixed, 
         a.multiple_flg, 
         a.name1, a.name2, a.address1, a.address2, a.address3,     
         a.address4,a.city, a.state, a.postal, a.country, a.pymnt_method, a.gross_amt,  
         a.currency_pymnt 
  FROM table_name a 
  where  to_char(a.LASTUPDDTTM,'YYYY-MM-DD HH24:MI:SS') &gt; :1 
  order by a.user_vchr_char2, a.pymnt_cnt, a.uap_clm_pymnt_stat
  </code></pre>
  
  <p>I tried adding <code>index</code> in the table which are used in <code>order by</code> but no improvement was visible. Could anyone please help. Please be simple as i am totally new to this field.</p>
  
  <p>Thanks!</p>