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 > Database Server Software > DB2 > improve the performance of queries

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-27-07, 12:11
ani_dbforum ani_dbforum is offline
Registered User
 
Join Date: Nov 2007
Posts: 32
improve the performance of queries

Hi,

I've 10 large tables each have around 20 million records.
while retreiving queries using joining of 3 to 4 tables with some conditions, the execution takes very long time and performance become a concern.

What are the ways to improve the performance of the queries?
Actually the queries are for datawarehousing reports and joins more than 3 tables.

Please suggest on Indexing, table splits and any other ways to improve the performance.
Reply With Quote
  #2 (permalink)  
Old 11-27-07, 12:30
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
MDCs, MQTs

Quote:
Originally Posted by ani_dbforum
Hi,

I've 10 large tables each have around 20 million records.
while retreiving queries using joining of 3 to 4 tables with some conditions, the execution takes very long time and performance become a concern.

What are the ways to improve the performance of the queries?
Actually the queries are for datawarehousing reports and joins more than 3 tables.

Please suggest on Indexing, table splits and any other ways to improve the performance.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 11-27-07, 12:44
ani_dbforum ani_dbforum is offline
Registered User
 
Join Date: Nov 2007
Posts: 32
I'm using db2v8. I'll try with MDC and MQT (I'm new to Db2 and need to search )
The tables are already created. Can the reorg of Indexes with Runstats help?
Reply With Quote
  #4 (permalink)  
Old 11-28-07, 08:05
anant123123 anant123123 is offline
Registered User
 
Join Date: Nov 2007
Posts: 21
Creating some more indexes will improve the performance. Need to check what are the coloumns require the indexes.
Reply With Quote
  #5 (permalink)  
Old 11-28-07, 12:01
ani_dbforum ani_dbforum is offline
Registered User
 
Join Date: Nov 2007
Posts: 32
How to see the index on which coloumns they are created?
I need to see the indexes and their keys.
Reply With Quote
  #6 (permalink)  
Old 11-28-07, 15:44
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
db2 describe indexes for schema.table show detail
Reply With Quote
  #7 (permalink)  
Old 11-29-07, 08:03
ani_dbforum ani_dbforum is offline
Registered User
 
Join Date: Nov 2007
Posts: 32
Left Outer Join

are the below queries give same result?

QUERY1:

SELECT A.DEPTNAME,
A.DEPTNO, A.BUILDING_NO,B.CALL_LETTERS, B.EMP_CITY]
FROM
ORG.DEPT A LEFT OUTER JOIN ORG.EMP B
ON
A.DEPTNO=B.DEPTNO
WHERE
(A.JOINING_DATE= '2005-01-01 11:16:30.0' OR
B.JOINING_DATE= '2005-01-01 11:16:30.0')


query2:

SELECT A.DEPTNAME,
A.DEPTNO, A.BUILDING_NO,B.CALL_LETTERS, B.EMP_CITY
FROM
ORG.DEPT A LEFT OUTER JOIN ORG.EMP B
ON
A.DEPTNO=B.DEPTNO
AND
A.JOINING_DATE= '2005-01-01 11:16:30.0'
OR
B.JOINING_DATE= '2005-01-01 11:16:30.0'
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