Virtual Catalogs

Kinetica provides metadata tables, or virtual catalogs, as a means of querying the database for information about its objects, relationships, and permissions.

Virtual catalogs can be used to easily search for database tables & views by name without knowing the containing schema name, or for database columns by name without knowing the containing table or view name. They can be used to generate reports of the database structure or audit the creation & modification of that structure.

Kinetica provides its own set of virtual catalog tables, and supports both ANSI & PostgreSQL metadata queries.

The information returned when querying the virtual catalogs is automatically filtered by the permissions of the querying user. For instance, regular users will only see the tables & views to which they have access when querying a virtual catalog table that lists all of the tables in the database, while system administrators will see all tables & views.


Kinetica Virtual Catalog

The Kinetica virtual catalog tables reside in the ki_catalog schema.

Virtual Catalog TableDescription
ki_columnsLists columns of tables & views and their respective types & statistics.
ki_datatypesLists supported column data types.
ki_fk_constraintsLists foreign keys, one record per column specified in each foreign key
ki_functionsLists scalar, aggregate, window, and user-defined functions.
ki_object_permissionsLists privileges granted, including the grantee, privilege type, and object to which access was granted.
ki_objectsLists tables & views and their respective types & statistics.
ki_role_membersLists users & roles and their granted roles, one record per user/role or role/role pair.
ki_schemasLists schemas.
ki_tiered_objects

Lists tiered objects and their size within those tiers.

Tip

To retrieve the tiering information for a particular object, the object must be queried by fully-qualified name using the pseudo-column outer_object:

SELECT *
FROM ki_tiered_objects
WHERE outer_object = '<schema_name>.<object_name>'

To find the total RAM usage of an employee table, one could use:

SELECT SUM(size)/1000000.0 AS ram_size_in_mb
FROM ki_tiered_objects
WHERE outer_object = 'example.employee'
AND tier = 'RAM'
ki_users_and_rolesLists users & roles.

ANSI Virtual Catalog

The ANSI virtual catalog tables reside in the INFORMATION_SCHEMA schema.

Virtual Catalog TableDescription
APPLICABLE_ROLES

Lists users & roles. This is only a simple list, one record per unique user or role--it is not a list of mappings of roles to users and roles to roles.

  • ROLE_NAME - name of user or role
  • IS_GRANTABLE - TRUE for roles and FALSE for users
ATTRIBUTESNot populated.
COLUMNSLists columns of tables & views and their respective types & statistics.
DATABASESContains a single record with the database name, root.
ENABLED_ROLESLists users & roles.
FIELDSList is the same as the COLUMNS table, but includes the object type of the containing table or view.
INFORMATION_SCHEMA_CATALOG_NAMEContains a single record with the catalog name, kinetica.
KEY_COLUMN_USAGELists primary & foreign keys and their associated columns.
OBJECT_PRIVILEGESLists privileges granted, including the grantee, privilege type, and object to which access was granted.
REFERENTIAL_CONSTRAINTSLists foreign keys and their referenced unique constraints.
ROLE_TABLE_GRANTSList is the same as the TABLE_PRIVILEGES table.
SCHEMATALists schemas.
TABLESLists tables & views and their respective types & statistics.
TABLE_CONSTRAINTSLists primary & foreign keys and their respective types & statistics.
TABLE_PRIVILEGESLists privileges granted on tables & views.
VIEWSLists views and their respective definitions & statistics.
functionsLists scalar, aggregate, window, and user-defined functions.

PostgreSQL Virtual Catalog

The PostgreSQL virtual catalog tables reside in the pg_catalog schema.

Virtual Catalog TableDescription
pg_attrdefLists columns that have default values.
pg_attributeLists columns of tables & views and their respective types & statistics.
pg_auth_membersLists users & roles and their granted roles, one record per user/role or role/role pair.
pg_authidLists users & roles and their respective attributes.
pg_classLists tables & views and their respective types and column counts.
pg_constraintLists primary & foreign keys.
pg_databaseContains a single record with the database name, kinetica.
pg_default_aclContains a single record with the default table ACL for the public role.
pg_descriptionLists comments for tables & views.
pg_indexLists indexes and their respective configurations.
pg_languageContains a single record with the supported procedure language, SQL.
pg_namespaceLists schemas.
pg_procLists scalar, aggregate, window, and user-defined functions.
pg_sequenceNot populated.
pg_typeLists supported column data types.