Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.server -> Oracle, speed up query

Oracle, speed up query

From: Louis <>
Date: 22 Jul 2004 08:03:46 -0700
Message-ID: <>

Hi everyone,

I would like to say that i'm really new to Oracle. I started to read about it 1 month ago. I am currently writting an Excel application to query some data from an Oracle database. I use Excel 2002, OO4O and Oracle
I just want to retrieve data, nothing more.

My question is about getting some help to speed up my query. I can't change the database so the optimization has to be in my code.

This is my tables:

So far, 4-5k entries, but it will get higher as time goes This is where I get most of my information. Some fields are number(keys?) and I have to get the description in the other tables.

small, 30-40 entries

15k entries so far, and will increase a little. Information about equipment. description, number, ...

100-200 entries. Same thing, I use this table to get the name of the location because I have the number in the workorder table


I retrieve a lot of information in the workorder table, but I need to join with other table to get the description instead of using a code. For example, in workorder.eqnum I have the number of the equipment, but I need to get the description of the equipement in equipment.eqnum. So I do an outter join AND workorder.eqnum = equipment.eqnum(+) and I add equipment.description in my select.

Query :

SELECT workorder.wonum as NUMBT, workorder.status as STATUT, workorder.reportedby as DEMANDEUR, as RESPONSABLE, workorder.description as DESCRIPTIONCOURTE, workorder.eqnum as NUMEQUIPEMENT, equipment.itemnum as NUMECRI, equipment.modelnum AS NUMMODEL, as DESCRIPTIONFABRIQUANT,
equipment.description as DESCRIPTIONANG,
equipment.description2 as DESCRIPTIONFRA,
workorder.location as NUMEMPLACEMENT, locations.description as
TO_CHAR(workorder.actlabhrs, '000.00') as TEMPSMO,
TO_CHAR(workorder.actlabcost, '000000.00') as COUTMO,
TO_CHAR(workorder.actmatcost, '000000.00') as COUTMATERIEL,
workorder.worktype as TYPEBT, labor.craft as METIER, 
workorder.statusdate as DATESTATUT,
workorder.ACTFinish as DATEFIN, workorder.reportdate as DATERAPPORT"

FROM workorder, labor, locations, equipment, companies WHERE workorder.supervisor = labor.laborcode(+)

AND workorder.location = locations.location(+)
AND workorder.eqnum = equipment.eqnum(+)
AND equipment.manufacturer =

if(condition) AND workorder.supervisor=ComboBox_Supervisor.Text if(condition) AND workorder.location=ComboBox_Location.Text (From the GUI, the user can select some more narrowed search)

Is there a way to speed up my query. I can get around 3k result in a little less than 1 min, but it seems pretty slow. I'm sure you guys will need more information to answer, but I don't know what to add. Tell me how to get the information and I will post it here.

Thanks a lot!

Louis Received on Thu Jul 22 2004 - 10:03:46 CDT

Original text of this message