Hi,
I have an overall view about db2 index and its usage. I read this article
http://www.dbazine.com/mullins_db2indexing.shtml about db2 index and usage, where i have few doubts.
PLEASE ALSO RECOMMEND FEW GOOD BOOKS IN DB2 PROGRAMING(from basics) AND DB2 ADMINISTRATION.
i am using db2 v7.2 on aix/win2000 with fickpack 11
1)How to decide which index to use (btree or cluster index or any) under what cirsumstances. By looking at a query can we decide or any other information is required to decide this. some example's of query and how to decide this."few points are also mentioned in this site".
2)For all columns in GROUP BY and ORDER BY can i create a cluster index or i need to decide this based on some factors. if ,so what factors should i look and recommend for cluster index.
3)what does "If indexing a table, explicitly create a clustering index" mean ?
please also post some web reference.
Regards
Banu
3/explicitly create a clustering index
If you don't define one of your indexes as clustering (the index by which your data is ordered on disk), DB2 will decide the clustering index for you. It will take the oldest (first created) index as clustering index.
Problem with this is, when you drop your first index and recreate it, it is no longer the oldest. DB2 will then change the clustering index to (again) the oldest index, which can have a big effect on performance.
To avoid this, you can create 1 index as clustering index so you are always in control of which index is determining the sorting order of your data on disk.
/Silk