IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

How to access SYSCAT.INDEXES


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

New User


Joined: 27 Mar 2006
Posts: 66

PostPosted: Thu Apr 25, 2013 1:08 am
Reply with quote

Hi,

I want to identify the unused Indexes in our application. I am trying to get that information from the system catalog table, SYSCAT.INDEXES, but I am getting SQL code -204, ERROR: SYSCAT.INDEXES IS AN UNDEFINED NAME.

Can any one please help me in finding out the unused Indexes.

Thank you,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19251
Location: Inside the Matrix

PostPosted: Thu Apr 25, 2013 1:32 am
Reply with quote

Hello,

Where did you find/learn SYSCAT.INDEXES?

There is no such system table . . .

If there was one, how would querying it identify unused indexes?
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 66

PostPosted: Thu Apr 25, 2013 1:44 am
Reply with quote

Hi Dick Scherrer,


I found the information in the below link
Use [URL] BBCode for Links



It mentions,

To identify opportunities to save space and maintenance overhead, you can examine last used information for indexes every year by checking the LASTUSED column in the SYSCAT.INDEXES catalog view.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8568
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 25, 2013 2:21 am
Reply with quote

From the top of the page I got which I clicked on your link:
Quote:
DB2 Version 9.7 for Linux, UNIX, and Windows
Mainframe DB2 is not the same as DB2 for Linux, UNIX, and Windows.
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 66

PostPosted: Thu Apr 25, 2013 2:23 am
Reply with quote

So is there any other way to get the unused Indexes
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1018
Location: India

PostPosted: Thu Apr 25, 2013 9:58 am
Reply with quote

Hi ravikumar15,

You should be looking at SYSIBM.SYSINDEXSPACESTATS

Regards,
Sushanth
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6251
Location: Mumbai, India

PostPosted: Thu Apr 25, 2013 10:05 am
Reply with quote

For each index, a new real-time statistics column (LASTUSED) is maintained in table SYSIBM.SYSINDEXSPACESTATS. It is updated whenever the index is used in SELECT/FETCH, searched UPDATE/DELETE, Referential Integrity checking. The column is not updated for INSERT, LOAD, etc.

Be careful with indexes that enforce uniqueness.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Access file which has DSNTYPE=LIBRARY JCL & VSAM 17
No new posts how to interrogate an Optim Access De... DB2 2
No new posts SDSF limit access to specifc output c... All Other Mainframe Topics 1
No new posts WSL-ADSL conversion in Webservice acc... DB2 0
No new posts how can I access zEDC shared disk fro... Interview Questions 3

Back to Top