|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Query tuning
Hi All,
I have 4 tables. I wrote one query as follows. But it's taking 45 mins for executing. Can you please write a query for this to improve performance.the tables are as follows. 1. Case 2. Item 3. Master 4. Warehouse columns are Case : Item, Supply_indicator , Country_Indicator , item_size Item : Item , location ,location_type, ondate, offdate,status,create_date Master :item , status, pack_indicator, Item_level(either 1 or 0),Trns_level(either 1 or 0),create_date,Foreind (either Y or N) Warehouse : Warehose_no, Name , Address [/pre] Code:
SELECT im.location , im.item , cs.case_size , im.ondate , im.offdate , mas.status
FROM case_size cs,
item im,
master mas,
warehouse wh
WHERE mas.pack_ind = 'N'
AND mas.item_level = mas.trns_level
AND mas.status = 'A'
AND mas.foreind = 'Y'
AND mas.item = im.item
AND im.location_type = 'S'
AND mas.item = cs.item
AND cs.supply_indicator = 'Y'
AND cs.country_indicator = 'Y'
AND im.location =wh.warehose_no
AND NVL(wh.CLOSE_DATE,'04-APR-9999')>=TO_DATE(&versDATE}, 'YYYYMMDD')
pls help me in this issue.. Thank you, Last edited by pabloj : April 15th, 2008 at 12:49 PM. |
|
#2
|
|||
|
|||
|
Quote:
What did you try to achieve from the statement below Code:
AND NVL(wh.CLOSE_DATE,'04-APR-9999')>=TO_DATE(&versDATE}, 'YYYYMMDD') Also which fields did you index for 4 of the tables you mention above. |
|
#3
|
|||
|
|||
|
In order to begin performance tunning your sql, I suggest you execute an explain plan and review if you are missing any indexes, ...etc...
![]()
__________________
|
|
#4
|
|||
|
|||
|
Quote:
I would use AND (wh.CLOSE_DATE IS NULL OR wh.CLOSE_DATE>=TO_DATE(&versDATE}, 'YYYYMMDD') Khan |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Query tuning |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|