Doubt with DB2 Index , Help me out.



IBM's flagship relational database management system

Doubt with DB2 Index , Help me out.

Postby manojlives » Fri Nov 06, 2009 2:37 pm

I have a table with 5 columns and 3 indexes .
the table already had few rows, i newly inserted few row to the table , and when i queried the table the rows fetched were out of order. the highlighted rows are inserted by me.

cola -- has a clustered index in ascending order
colb -- has a non clustered index in ascending order
cole -- has a non clustered index in ascending order

I tries to rebuild and reorg all the 3 indexes and still the data order remains the same. can any body pls help me out.

cola colb colc cold cole

09/01/2009 09/18/2009 10/15/2009 10/15/2009 11/15/2009
10/01/2009 10/20/2009 11/15/2009 11/15/2009 12/15/2009
11/01/2009 11/17/2009 12/15/2009 12/15/2009 01/15/2010
12/01/2009 12/18/2009 01/15/2010 01/15/2010 01/31/2010
12/01/2010 12/21/2010 01/15/2011 01/15/2011 01/31/2011
11/01/2010 11/19/2010 12/15/2010 12/15/2010 01/15/2011
10/01/2010 10/20/2010 11/15/2010 11/15/2010 12/15/2010
09/01/2010 09/21/2010 10/15/2010 10/15/2010 11/15/2010
08/01/2010 08/20/2010 09/15/2010 09/15/2010 10/15/2010
07/01/2010 07/21/2010 08/15/2010 08/15/2010 09/15/2010
manojlives
 
Posts: 37
Joined: Wed Dec 24, 2008 5:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Doubt with DB2 Index , Help me out.

Postby swd » Fri Nov 06, 2009 7:17 pm

Try REORGing the tablespace as well. It will then unload the data, sort it and load it back in the correct order. Try that and see what you get.
User avatar
swd
 
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time

Re: Doubt with DB2 Index , Help me out.

Postby dick scherrer » Sat Nov 07, 2009 1:14 am

Hello,

when i queried the table the rows fetched were out of order
Sorry, but no. . .

If you do not specify an ORDER BY, there is no "out of order". If you want rows returned in a particular order, you need to specify this in your query.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post