|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi All,
This is my first post and a very urgent post. I have requirment to find out if the incomming offer id is present in the specified table (table is having more than 1billion records) or not. the query which i ran was select ofr_id from table tbl where fr_id = tbl.ofr_id fetch first rows only.this query is running fine if the number of incomming records are not more than 10. can any one please optimize this query to whatever level its possible plzz. |
|
#2
|
||||
|
||||
|
you have created an index on that column?
|
|
#3
|
|||
|
|||
|
Quote:
Yes it is an index column. |
|
#4
|
|||
|
|||
|
Quote:
Which RDBMS is this? Show us the full DDL of all tables involved including index definitions. Show us the execution plan of the current statement. |
|
#5
|
|||
|
|||
|
Quote:
I am using an ETL tool called as Ab-Initio. The DBMS is DB2 , DDL of table which needs to be updated is acct_id number(10) ofr_id number(6) ofr_ts datetime ptn_num number(2).....this is basically the last two digits of acct_id. These are the primary keys. We are getting few invalid offer ids are which if present in table needs to be reported. This table is having more than 1 billion records. The excution time is as follows. 2 offer ids - 2sec 10 offer ids - 15 mins 25 offer ids - 1hour 15 mins 50 offer ids - Session got expired During testing number of offer ids would be not less than 300-500... Please let me know if you need some more information. |
|
#6
|
||||
|
||||
|
Quote:
those columns are all part of the primary key??? in any case, it looks like you don't have a separate index on ofr_id, which is what you need in order for that query you posted to be efficient also, can we see the query that you are running for more than one incoming ofr_id? also, i'm moving this thread to the DB2 forum |
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > Need Optimised query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|