Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find all indexes available on a table in DB2

Tags:

indexing

db2

How to find all indexes available on table in db2?

like image 257
Rumik Avatar asked May 20 '10 11:05

Rumik


People also ask

How can I see all indexes on a table?

To see indexes for all tables within a specific schema you can use the STATISTICS table from INFORMATION_SCHEMA: SELECT DISTINCT TABLE_NAME, INDEX_NAME FROM INFORMATION_SCHEMA. STATISTICS WHERE TABLE_SCHEMA = 'your_schema'; Removing the where clause will show you all indexes in all schemas.

Where are indexes stored in DB2?

INDEX is an ordered set of pointers to the rows of table data. DB2 uses indexes to uniqueness and improve the performance. An index is stored separately from the data in table. Index's are physically stored in its index space.

How many indexes can be created on a table in DB2?

Any number of indexes can be defined on a particular table, to a maximum of 32 767, and they can have a beneficial effect on the performance of queries. The index manager must maintain the indexes during update, delete and insert operations.

How many indexes does a table have?

There can be only one clustered index per table, because the data rows themselves can be stored in only one order.


1 Answers

db2 "select * from syscat.indexes where tabname   = 'your table name here' \
                                  and   tabschema = 'your schema name here'"
like image 102
Ingo Avatar answered Sep 19 '22 13:09

Ingo