Page 1 of 1

DB2 Indexing

PostPosted: Fri Nov 12, 2010 5:36 pm
by maragatham
Hi,

I am asked to improve the performance of 2 individual queries.
First query searches on column A of Table1. Column A has unique values.
Second query searches on column B of Table1. Column B is not unique.
Obviously a combination of COL A and COL B is unique.

And I found that there are no indexes defined on these columns.
Will an index on (COL A, COL B) improve performance on these individual queries??

Please let me know if it is OK for me to raise a request to create an index on Table1 on (COL A, COL B)?

Re: DB2 Indexing

PostPosted: Fri Nov 12, 2010 9:50 pm
by alexm
Basically, indexes were introduced to help optimizing performance ;) .
Whether you should request new indexes on the questionable table(s) is depending on many other facts, such as: how often are these "individual" queries performed, what's the size of the objects, what's the update frequency onto the tables (DB2 needs to maintain the indexes, and because of this, performance degradation on updaters may occur), etc. etc.

You might want consider to speak to your database designers, performance group, or whoever else cares about these things in your shop.

Re: DB2 Indexing

PostPosted: Sat Nov 27, 2010 6:33 pm
by RENGANATHAN
let thnk abt the table size,f the table size is small index will not help in perfomnce,if t is big ,create a index for that row and the table will go for index scan only ,performance will be gud

Re: DB2 Indexing

PostPosted: Sat Nov 27, 2010 6:42 pm
by enrico-sorichetti
this is not an sms or a chat line...
please, please,
have Your keyboard fixed or type more slowly or learn how to express Yourself properly.
Thank You!

Re: DB2 Indexing

PostPosted: Sat Nov 27, 2010 6:59 pm
by RENGANATHAN
hey brother

if the table having 100 rows means index scan will not help to improve the performance,so db2 will go for tablescan.

if ur table having nearly thousands of record means index scan will improve the performance...

so decide to create the index depend upon your table size.

Re: DB2 Indexing

PostPosted: Sun Nov 28, 2010 9:26 am
by dick scherrer
Hello,

Enrico is not your brother. . .

You need to make sure that you post replies that are appropriate rather than chatroom slang/abbreviations.

You also need to make sure your reply provides an answer/solution to the question asked. Your replies some other topics have been deleted for this reason.