HPlogo ALLBASE/SQL Database Administration Guide: HP 3000 MPE/iX Computer Systems > Chapter 8  System Catalog

System.ConstraintIndex

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

SYSTEM.CONSTRAINTINDEX contains an entry for each integrity constraint. This view is initially empty, but is updated whenever ALLBASE/SQL processes a CREATE TABLE, DROP TABLE, ALTER TABLE TRANSFER OWNERSHIP (of a table), or UPDATE STATISTICS statement involving an integrity constraint.

Table 8-10 System.ConstraintIndex

Column NameTypeLengthDescription
CONSTRAINTNAMECHAR20Name of the unique or referential constraint
TABLENAMECHAR20Name of the table on which the index is defined
OWNERCHAR20Owner of the table on which the index is defined
NUMCINTEGER4Number of columns in the index
COLNUMSBINARY32 A vector of 16 SYSTEM.COLUMN entries, each of type SMALLINT, identifying the column numbers the index is defined over. In ISQL, each SMALLINT (two-byte) entry is displayed as a field of 4 hexadecimal digits.
NPAGESINTEGER4Number of data pages containing the constraint index
CCOUNTINTEGER4Cluster count; indicates how well the data of the index are sorted:
   

0

before first UPDATE STATISTICS statement is processed

n

efficiency of clustering: best clustering if n=NPAGES of table indexed; worst if n=NROWS of table indexed

CTIMECHAR16Time the index was created
UNIQUESMALLINT2Uniqueness indicator:
   0 if duplicates are allowed, that is, the index is not unique
   1 if duplicates are not allowed, that is the index is unique
CLUSTERSMALLINT2Clustering indicator:
   0 if the index is not a clustering index
   1 if the index is the clustering index for the table
COLDIRSBINARY32

A vector of 16 direction entries, each of type SMALLINT, indicating the direction of the corresponding column in the index definition. In ISQL, each SMALLINT (two-byte) entry is displayed as a field of 4 hexadecimal digits. The following values indicate a specific direction:

   5 ASC (Ascending)
   6 DESC (Descending)

 

Example



   SELECT * FROM System.ConstraintIndex;

   --------------------+--------------------+--------------------+-----------

   CONSTRAINTNAME      |TABLENAME           |OWNER               |NUMC

   --------------------+--------------------+--------------------+-----------

   SQLCON_00000001P00  |PARTS1              |PURCHDB             |          1

   CLUBS_PK            |CLUBS               |RECDB               |          1

   MEMBERS_PK          |MEMBERS             |RECDB               |          2

   MEMBERS_FK          |MEMBERS             |RECDB               |          1

   EVENTS_FK           |EVENTS              |RECDB               |          2

   ---------------------------------------------------------------------------

   Number of rows selected is 5

   U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>, or e[nd]> r

   +----------------------------------------------------------------+------------

   |COLNUMS                                                         |NPAGES      

   +----------------------------------------------------------------+------------

   |0001000000000000000000000000000000000000000000000000000000000000|           0

   |0001000000000000000000000000000000000000000000000000000000000000|           0

   |0001000000000000000000000000000000000000000000000000000000000000|           0

   |0002000000000000000000000000000000000000000000000000000000000000|           0

   |0001000000000000000000000000000000000000000000000000000000000000|           0

   ------------------------------------------------------------------------------

   Number of rows selected is 5

   U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>, or e[nd]> r



   +-----------+----------------+------+-------

   |CCOUNT     |CTIME           |UNIQUE|CLUSTER

   +-----------+----------------+------+-------

   |          0|1990040914185800|     1|      0

   |          0|1990040914203800|     1|      0

   |          0|1990040914280600|     1|      0

   |          0|1990040914280600|     0|      0

   |          0|1990040914295500|     0|      0

   ---------------------------------------------------------------------------

   Number of rows selected is 5

   U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>, or e[nd]> e





   +----------------------------------------------------------------+

   |COLDIRS                                                         |

   +----------------------------------------------------------------+

   |0005000000000000000000000000000000000000000000000000000000000000|

   |0005000000000000000000000000000000000000000000000000000000000000|

   |0005000000000000000000000000000000000000000000000000000000000000|

   |0005000000000000000000000000000000000000000000000000000000000000|

   |0005000000000000000000000000000000000000000000000000000000000000|

   |0005000000000000000000000000000000000000000000000000000000000000|

   |0005000000000000000000000000000000000000000000000000000000000000|

   |0005000000000000000000000000000000000000000000000000000000000000|

   |0005000000000000000000000000000000000000000000000000000000000000|

   ------------------------------------------------------------------------

   Number of rows selected is 9

   U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>,or e[nd]> e


Feedback to webmaster