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 > How much performance hit if I create index on all columns

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-14-09, 21:53
mowry_889 mowry_889 is offline
Registered User
 
Join Date: Aug 2009
Posts: 13
How much performance hit if I create index on all columns

How much performance hit if I create index on all columns.

Let's say I have a table with 20 columns and index on each column.

How much peformance/overhead with and without indexes?

Thanks,
Veera
Reply With Quote
  #2 (permalink)  
Old 09-15-09, 02:47
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
It depends... If you do mostly queries like in a data warehouse, it is beneficial to create all possible indexes. If you have more of an OLTP workload, you only want to create the indexes that you really need due to the added index maintenance overhead.

Furthermore, I wouldn't simply create indexes on all columns. It may be better to have an index on a combination of columns and you may not need indexes on some columns. Therefore, a good start would be to run your SQL statements as workload through the Design Advisor and see what indexes are suggested by that tool. The next step is to understand how indexes work (e.g. what is index-only access, prefetching, include columns, just to name very few) and then apply this knowledge to your workload.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 09-15-09, 03:38
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by mowry_889
How much performance hit if I create index on all columns.

Let's say I have a table with 20 columns and index on each column.

How much peformance/overhead with and without indexes?

Thanks,
Veera
Big hit, and you probably want some composite indexes and not just indexes with one column. Probably less than 5 of the indexes will ever be used by DB2, but DB2 will have to maintain them on inserts, updates, and deletes.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
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