Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
use timestamp as index?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: use timestamp as index?
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Converting EBCDIC to Unicode (TimeStamp) muralikrishnan_new COBOL Programming 2 Mon Jul 25, 2016 10:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us