Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

need to speed up queries

$
0
0
Hi,
I'm using DB2 10.1 ESE on Linux.

My application runs 3 queries that are similar and all take long time to complete.


The queries structure is:

select t.col2, t.col3, t.col4 from MYSCHEMA.BIG_DATA_TABLE t , SESSION.ENABLED_SYSTEMS S where t.col1=s.col1 and t.col5=1

SESSION.ENABLED_SYSTEMS is a temporary table that is shared among all the 3 queries, it contains just an integer and has a size up to 300K rows.

MYSCHEMA.BIG_DATA_TABLE is a different table for the 3 queries, but in all the cases it contains a big number of rows (60 million the first, 30 million the second, 20 million the third).

In two cases all the involved columns are integer or smallint, just in the first case col3 is varchar(8000).

I tried a "index only access" approach and created an index for each of the 3 tables like:
create index MYSCHEMA.BIG_DATA_TABLE_IDX on MYSCHEMA.BIG_DATA_TABLE (col1,col5,col2,col3,col4)

(in order of decreasing cardinality for the predicate columns, couldn't use include clause because the index cannot be unique)

but the queries take too much time (from 2 to 4 minutes), I need to dramatically cut this time.

Could you please suggest how can achieve this?

Thank you!

Viewing all articles
Browse latest Browse all 13329

Trending Articles