[askdba] lot of time taking on qa than production

  • From: drumil narayan <drumilnarayan@xxxxxxxxx>
  • To: askdba@xxxxxxxxxxxxx
  • Date: Fri, 8 Aug 2008 20:04:27 +0530 (IST)

Our production and qadatabases are same in structure and hardware.
following query is taking approx 2 minutes to fetch about 4568878 where as am 
firing the same query on qa it is still running.
no of indexs and columns are identical on the both the databases..where should 
i look for..
 
select m.sic_code sic_code from
zips z,
addresses a,
memberships m,
territorys t 
where m.MEM_SOURCE != 'MCCOY NOM' 
and m.mem_type = 'GOV'
and ((m.CANCEL_TYPE IS NULL OR m.CANCEL_TYPE IN('REINSTATE','EXTENSION') OR 
m.CANCEL_TYPE LIKE 'PO%') OR SYSDATE - m.CANCEL_DT < 366) 
and m.mem_id = a.mem_id
and a.addr_type ='BUS'
and a.zip_code = z.zip_code
and substr(lpad(to_char(abs(z.zip_code)),9,'0'),1,5) = t.zip_code
and z.state=t.state
and z.county=t.county_code
thanks


      Unlimited freedom, unlimited storage. Get it now, on 
http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/

Other related posts: