Note

This documentation is for a prior release of Kinetica. For the latest documentation, click here.

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_columnsColumns of tables & views and their respective types & statistics.
ki_contextsSQL-GPT contexts and their configuration.
ki_datasource_subscriptionsKafka data subscriptions, associating Kafka data sources with their target load tables.
ki_datasourcesExternal data sources, their containing schemas and types.
ki_datatypesSupported column data types.
ki_dependObject dependencies for views, procedures, and result tables.
ki_fk_constraintsForeign keys, one record per column specified in each foreign key.
ki_functionsScalar, aggregate, window, and user-defined functions.
ki_ingest_file_infoName & date of data files loaded into the database.
ki_load_historyRecord & statistics of each data load or export, subscription event, and data refresh.
ki_obj_statRow & byte counts for each object in the database.
ki_object_permissionsPrivileges granted, including the grantee, privilege type, and object to which access was granted.
ki_objectsTables & views and their respective types & statistics.
ki_query_active_allActively running SQL statements per worker rank, including DML & DDL.
ki_query_historyHistory of SQL statements run within the database, including DML & DDL; will not include multi-head ingest/egress.
ki_query_span_metrics_allProcessing metrics captured during the execution of commands on worker ranks.
ki_query_workersWorker ranks' status and their actively running tasks.
ki_role_membersUsers & roles and their granted roles, one record per user/role or role/role pair.
ki_schemasSchemas, containing all database objects.
ki_tiered_objects

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_rolesUsers & user roles.

ANSI Virtual Catalog

The ANSI virtual catalog tables reside in the INFORMATION_SCHEMA schema.

Virtual Catalog TableDescription
APPLICABLE_ROLES

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 used.
CHARACTER_SETSContains a single record with the supported character set, UTF-8.
COLUMNSColumns of tables & views and their respective types & statistics.
CONSTRAINT_COLUMN_USAGEColumns with constraints and their containing schemas.
CONTEXT_RULESRules sections of SQL-GPT contexts.
CONTEXT_SAMPLESSamples sections of SQL-GPT contexts.
CONTEXT_TABLE_COLUMNSColumns of tables associated with SQL-GPT contexts.
CONTEXT_TABLESTables associated with SQL-GPT contexts.
CONTEXTSSQL-GPT contexts and their configuration.
DATABASESContains a single record with the database name and owner.
ENABLED_ROLESUsers & roles.
FIELDSColumns of tables & views and their respective types & statistics, also containing the object type of the containing table/view.
FUNCTIONSScalar, aggregate, window, and user-defined functions.
INFORMATION_SCHEMA_CATALOG_NAMEContains a single record with the catalog name, kinetica.
KEY_COLUMN_USAGEPrimary & foreign keys and their associated columns.
KI_CATALOG_VERSIONContains a single record with the virtual catalog schema version.
KI_LOAD_HISTORYRecord & statistics of each data load or export, subscription event, and data refresh.
KI_QUERY_ACTIVEActively running SQL statements, including DML & DDL.
KI_QUERY_HISTORYHistory of SQL statements run within the database, including DML & DDL; will not include multi-head ingest/egress.
KI_QUERY_SPAN_METRICSProcessing metrics of SQL statements run within the database, including DML & DDL; will not include multi-head ingest/egress.
KI_QUERY_SPAN_METRICS_BY_SQL_STEPProcessing metrics of SQL statements run within the database, aggregated on each execution phase of a given query/command.
KI_QUERY_WORKERSWorker ranks' status and their actively running tasks.
OBJECT_PRIVILEGESPrivileges granted, including the grantee, privilege type, and object to which access was granted.
REFERENTIAL_CONSTRAINTSForeign keys and their referenced unique constraints.
ROLE_TABLE_GRANTSAlias for the TABLE_PRIVILEGES table.
SCHEMATASchemas, containing all database objects.
SEQUENCESNot used.
TABLE_CONSTRAINTSPrimary & foreign keys and their respective types & statistics.
TABLE_PRIVILEGESPrivileges granted on tables & views.
TABLESTables & views and their respective types & statistics.
VIEWSViews and their respective definitions & statistics.

PostgreSQL Virtual Catalog

The PostgreSQL virtual catalog tables reside in the pg_catalog schema.

Virtual Catalog TableDescription
geography_columnsNot used.
geometry_columnsColumns of tables & views that have a GEOMETRY data type.
pg_aggregateNot used.
pg_amNot used.
pg_amopNot used.
pg_amprocNot used.
pg_attrdefColumns that have default values.
pg_attributeColumns of tables & views and their respective types & statistics.
pg_auth_membersUsers & roles and their granted roles, one record per user/role or role/role pair.
pg_authidUsers & roles and their respective attributes.
pg_classTables & views and their respective types and column counts.
pg_collationNot used.
pg_constraintPrimary & foreign keys.
pg_databaseContains a single record with the database name and information.
pg_default_aclContains a single record with the default table ACL for the public role.
pg_dependNot used.
pg_descriptionComments for tables & views.
pg_enumNot used.
pg_event_triggerNot used.
pg_extensionNot used.
pg_foreign_data_wrapperNot used.
pg_foreign_serverNot used.
pg_foreign_tableNot used.
pg_groupNot used.
pg_indexIndexes and their respective configurations.
pg_inheritsNot used.
pg_languageContains a single record with the supported procedure language, SQL.
pg_locksNot used.
pg_matviewsMaterialized views and their backing SQL, if created using SQL.
pg_namespaceSchemas, containing all database objects.
pg_opclassNot used.
pg_operatorNot used.
pg_opfamilyNot used.
pg_partitioned_tableNot used.
pg_policyNot used.
pg_procScalar, aggregate, window, and user-defined functions.
pg_rangeNot used.
pg_rewriteNot used.
pg_rolesUsers & roles and their respective attributes.
pg_sequenceNot used.
pg_settingsNot used.
pg_shdescriptionNot used.
pg_stat_activityNot used.
pg_stat_all_tablesRow & byte counts for each object in the database.
pg_statsColumns of tables & views and their respective types.
pg_tablesTables & views.
pg_tablespaceNot used.
pg_timezone_abbrevsContains a single record with the supported UTC timezone and its GMT offset.
pg_timezone_namesContains a single record with the supported UTC timezone name, abbreviation, and its GMT offset.
pg_triggerNot used.
pg_typeSupported PostgreSQL column data types mapped to Kinetica types.
pg_userUsers and their respective attributes.
pg_viewsLogical views and their backing queries.