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, 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.
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!