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

Indexing issue


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

New User


Joined: 05 Nov 2005
Posts: 28

PostPosted: Mon Jul 25, 2011 1:04 pm
Reply with quote

Explain shows that query1 uses index XTABLE12 but query2 does a TS scan. Can someone explain me why? & how to avoid the TS scan on query2?

Query:1
SELECT count(*)
FROM TABLE1
WHERE UPD_TIMESTAMP > '2011-03-25-09.25.55.415477'


Query:2
SELECT CONTRACT_NBR
FROM TABLE1
WHERE UPD_TIMESTAMP > '2011-03-25-09.25.55.415477'


The first index XPOM4011 is clustered & partitioned. I believe this is having some effect on indexing.

INDEX NAME COLUMN NAME COLSEQ ORD CLS
XTABLE11
CONTRACT_NBR 1 A Y
VNDR_NBR 2 A Y


INDEX NAME COLUMN NAME COLSEQ ORD CL
TABLE12
UPD_TIMESTAMP 1 A N
CONTRACT_STATUS 2 A N
CONTRACT_NBR 3 A N
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Jul 25, 2011 1:56 pm
Reply with quote

not enough info:
* Partitioning method, keys and ranges
* statistics for indexes,indexparts and column UPD_TIMESTAMP
* contents of PLANTABLE.PAGE_RANGE
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 XML Generate issue COBOL Programming 0
No new posts How to Login in to cics region and is... CICS 9
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Facing ABM3 issue! CICS 3
Search our Forums:

Back to Top