IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

use timestamp as index?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cima

New User


Joined: 22 Mar 2006
Posts: 8

PostPosted: Fri Jul 08, 2011 11:32 am
Reply with quote

Hi all,

I'm wondering if timestamp is useful to be included in the index to avoid internal sort. Or is it generally not recommended?

sample table:
create table tab1
(col1 char(1) not null
,col2 char(1) not null
,col3 char(1) not null
,col4 char(1) not null
,col5 char(1) not null
,col6 char(1) not null
,col7 char(1) not null
,col8 char(1) not null
,col9 char(1) not null
,timestamp not null)
in prototyp.tablespace

example sql:

exec sql
select * from tab1
where col1 = 'A'
order by timestamp;

thanks,
cima
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Jul 08, 2011 1:07 pm
Reply with quote

it depends on how many times you are planning to update that timestamp.

every update of a column in an index is possible cause for a delete/insert into the index.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Cobol file using index COBOL Programming 2
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Timestamp difference and its average ... DB2 11
No new posts DL/I status code AK for GU call using... IMS DB/DC 1
Search our Forums:

Back to Top