Interview Questions   Tutorials   Discussions   Programs   

DB2 - What is main use of table space and index object?

asked mar September 4, 2014 11:25 AM  

What is main use of table space and index object?


1 Answers

answered By Mswami   0  

A TableSpace is a VSAM File which stores or houses the DB2 Table-Data Physically. You can create a Brand-New Table-space File, by using the CREATE TABLESPACE Statement.The information about all Table-Space Files is stored in the DB2 Catalog Table SYSIBM.SYSTABLESPACE.

A tablespace is a storage location where the actual data underlying database objects can be kept. It provides a layer of abstraction between physical and logical data,[1] and serves to allocate storage for all managed segments. (A database segment is a database object which occupies physical space such as table data and indexes.) Once created, a tablespace can be referred to by name when creating database segments.

Tablespaces specify only the database storage locations, not the logical database structure, or database schema. For instance, different objects in the same schema may have different underlying tablespaces. Similarly, a tablespace may service segments for more than one schema. Sometimes it can be used to specify schema as to form a bond between logical and physical data.

An index is an ordered list of the key values of a column or columns of a table. There are two reasons why you might create an index: • To ensure uniqueness of values in a column or columns.

• To improve performance of queries against the table. The DB2 optimizer will use indexes to improve performance when performing queries, or to present results of a query in the order of the index.

Indexes can be defined as unique or nonunique.

Nonunique indexes allow duplicate key values; unique indexes allow only one occurrence of a key value in the list.

Unique indexes do allow a single null value to be present. However, a second null value would cause a duplicate and therefore is not allowed.

   add comment

Your answer

Join with account you already have



Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!