need help on optimizing my query
Posted by:
Apesu
Date: September 14, 2006 02:36AM
Hi
My query is taking alot of time and i was wondering if there is something i can do to make it go faster. Below is a sample of the query, rawqgate.map is a mergetable.
SELECT a.seizure_time as seizure_time, a.stop_time as stop_time, b.name as opc, c.name as dpc, a.octets_sent, a.octets_received, a.status, a.mus_sent as msu_sent, a.mus_received as msu_received, a.ni, a.origGlobalTitle, a.termGlobalTitle, a.calledPartyNoa, a.callingPartyNoa, a.calledNP, a.callingNP, a.calledSsn, a.callingSsn, f.name as sccpcause, d.name as firstOpcode, e.name as lastOpcode, a.otid, a.dtid, g.name as maperrorcode, a.firstMsgType, a.lastMsgType, a.firstMsgComponentType, a.lastMsgComponentType, a.imsi as imsi, a.msisdn, a.vlr, a.lmsi, a.msrn, a.TPoriginAddress, a.TPdestAddress, a.recipAddress FROM rawqgate.map a ,qgate_refdata.mappcmap b, qgate_refdata.mappcmap c, qgate_refdata.mapopcodemap d, qgate_refdata.mapopcodemap e, qgate_refdata.mapsccpmap f, qgate_refdata.mapmapmap g WHERE a.ni = b.ni and a.opc = b.pc and a.ni = c.ni and a.dpc = c.pc and a.sccpcause = f.sccp and a.firstOpcode = d.opcode and a.lastOpcode = e.opcode and a.maperrorcode = g.map and (a.seizure_time >= '2006-09-13 10:14:25') and (a.seizure_time <= '2006-09-14 10:14:25') and (a.imsi BETWEEN '220000000000000' and '230000000000000') and (a.msisdn like '%') and (a.origGlobalTitle like '%') and (a.termGlobalTitle like '%') limit 100