Quote:
Originally posted by tupiex
Hi
Not many people know or realise that the data with in a table will automatically lie in the oprder of the CLUSTERING index by default. If you do not specify a CLUSTERING index then rows will be in the order of the FIRST INDEX created.
Thus if you are getting data through a SELECT * in the incorrect order, this will be the problem.
|
Hi,
AFAIK it's even not sure you will get the data in the order of the clustering index or the first index created. If DB2 is using parallel IO to get the data it can be returned to the DB2 engine in a different order and without an order by it's directly returned to the requesting application.
There's also a difference between DB2 OS/390 and DB2 Unix/Windows when talking about clustering indexes. DB2 Unix/Windows tries to put the data in the right phisical order but you can't be sure it really is.
If I remember right from 10 years ago DB2 OS/390 fysically inserts the rows in the order of the clustering index.
Kind regards, Gert