If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Sql query taking long time

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-21-03, 01:49
parag_cg parag_cg is offline
Registered User
 
Join Date: Nov 2003
Location: India
Posts: 10
Red face Sql query taking long time

Hi Experts,
I am having problem with sql query. I am using the sql query for generation of reports . The query is using NOT IN clasue. The
query is taking aroound 1 hour to run. Even after creating index on it,
no use. Can any one help me to optimize the query.

Query:

SELECT COUNT(1) FROM ITEM_MASTER
WHERE ITEM_MASTER.ITEM_NUMBER
NOT IN (SELECT ITEM_MASTER.ITEM_DESC1
FROM
ITEM_MASTER,
DB_MASTER DB_MASTER_ITEM
WHERE
ITEM_MASTER.DB_CODE=DB_MASTER_ITEM.DB_CODE
AND
DB_MASTER_ITEM.REPORT_REGION_NAME = 'AMERICAS')



Thanks,
Parag
__________________
parag
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On