Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

DB_INDEX_KEY

Represents the key information of indexes created for the class for which the current user has access authorization in the database.

Attribute Name

Data Type

Description

index_name

VARCHAR(255)

Index name

class_name

VARCHAR(255)

Name of the class to which the index belongs

key_attr_name

VARCHAR(255)

Name of attributes that comprise the key

key_order

INTEGER

Order of attributes in the key. Begins with 0.

asc_desc

VARCHAR(4)

'DESC' if the order of attribute values is descending, and 'ASC' otherwise.

Definition

CREATE VCLASS db_index_key (index_name, class_name, key_attr_name, key_order)
AS
SELECT k.index_of.index_name, k.index_of.class_of.class_name, k.key_attr_name, k.key_order
FROM _db_index_key k
WHERE (CURRENT_USER = 'DBA' OR
        {k.index_of.class_of.owner.name} subseteq (
                SELECT set{CURRENT_USER} + coalesce(sum(set{t.g.name}), set{})
                from db_user u, table(groups) as t(g)
                where u.name = CURRENT_USER ) OR
        {k.index_of.class_of} subseteq (
SELECT sum(set{au.class_of})
                FROM _db_auth au
                WHERE {au.grantee.name} subseteq (
                            SELECT set{CURRENT_USER} + coalesce(sum(set{t.g.name}), set{})
                            from db_user u, table(groups) as t(g)
                            where u.name = CURRENT_USER ) AND
                                    au.auth_type = 'SELECT'));

Example

The following is an example of retrieving index key information of the class.

csql> select class_name, key_attr_name, index_name
csql> from db_index_key
csql> order by class_name, key_order;
csql> ;xrun
 
=== <Result of SELECT Command in Line 1> ===
 
  'athlete'             'code'                'pk_athlete_code'
  'city'                'city_name'           'pk_city_city_name'
  'db_serial'           'name'                'pk_db_serial_name'
  'db_user'             'name'                'i_db_user_name'
  'event'               'code'                'pk_event_code'
  'female_event'        'code'                'pk_event_code'
  'game'                'host_year'           'pk_game_host_year_event_code_athlete_code'
  'game'                'event_code'          'fk_game_event_code'
  'game'                'athlete_code'        'fk_game_athlete_code'