Skip to content

Metatables

About metatables

The metatables are tables that are used for checking metadata of data management in GridDB.

[Memo]

  • Metatables can only be referred. It is not allowed to register or delete data in the metatables.
  • When SELECT data from the metatables, it is necessary to enclose the table name with double quotation marks.

[Points to note]

  • The schema of metatables may be changed in future version.

Table information

Table information can be obtained.

Table name

#tables

Schema

Column nameItemType
DATABASE_NAMEDatabase nameSTRING
TABLE_NAMETable nameSTRING
TABLE_OPTIONAL_TYPETable type
COLLECTION / TIMESERIES
STRING
DATA_AFFINITYData affinitySTRING
EXPIRATION_TIMEExpiry release elapsed timeINTEGER
EXPIRATION_TIME_UNITExpiry release elapsed time unitSTRING
EXPIRATION_DIVISION_COUNTExpiry release division countSTRING
COMPRESSION_METHODTime series compression methodSTRING
COMPRESSION_WINDOW_SIZETime series compression max period of thinningINTEGER
COMPRESSION_WINDOW_SIZE_UNITTime series compression max period unit of thinningSTRING
PARTITION_TYPEPartitioning typeSTRING
PARTITION_COLUMNPartitioning keySTRING
PARTITION_INTERVAL_VALUEInterval value (For interval or interval hash)INTEGER
PARTITION_INTERVAL_UNITInterval unit (For interval of interval hash)STRING
PARTITION_DIVISION_COUNTDivision count (For hash)INTEGER
SUBPARTITION_TYPEPartitioning type
("Hash" for interval hash)
STRING
SUBPARTITION_COLUMNPartitioning key
(for interval hash)
STRING
SUBPARTITION_INTERVAL_VALUEInterval valueINTEGER
SUBPARTITION_INTERVAL_UNITInterval unitSTRING
SUBPARTITION_DIVISION_COUNTDivision count
(For interval hash)
INTEGER
EXPIRATION_TYPEExpiration type
ROW / PARTITION
STRING

Index information

Index information can be obtained.

Table name

#index_info

Schema

Column nameItemItem
DATABASE_NAMEDatabase nameSTRING
TABLE_NAMETable nameSTRING
INDEX_NAMEIndex nameSTRING
INDEX_TYPEIndex type
TREE / HASH / SPATIAL
STRING
ORDINAL_POSITIONColumn order in index (sequential number from 1)SHORT
COLUMN_NAMEColumn nameSTRING

Partitioning information

Data about partitioned tables can be obtained from this metatable.

Table name

#table_partitions

Schema

Column nameItemType
DATABASE_NAMEDatabase nameSTRING
TABLE_NAMEPartitioned table nameSTRING
PARTITION_BOUNDARY_VALUEThe lower limit value of each data partitionSTRING

Specifications

  • Each row represents the information of a data partition.
    • For example, when searching rows of a hash partitioned table in which the division count is 128, the number of rows displayed will be 128.
  • In the metatable "#table_partitions", the other columns may be displayed besides the above columns.
  • It is required to cast the lower limit value to the partitioning key type for sorting by the lower limit value.

Examples

  • Check the number of data partitions

    sh
    SELECT COUNT(*) FROM "#table_partitions" WHERE TABLE_NAME='myIntervalPartition';
      
    COUNT(*)
    -----------------------------------
     8703
  • Check the lower limit value of each data partition

    sh
    SELECT PARTITION_BOUNDARY_VALUE FROM "#table_partitions" WHERE TABLE_NAME='myIntervalPartition'
    ORDER BY PARTITION_BOUNDARY_VALUE;
      
    PARTITION_BOUNDARY_VALUE
    -----------------------------------
    2016-10-30T10:00:00Z
    2017-01-29T10:00:00Z
              :
  • Check the lower limit value of each data partitions on the interval partitioned table "myIntervalPartition2" (partitioning key type: INTEGER, interval value: 20000)

    sh
    SELECT CAST(PARTITION_BOUNDARY_VALUE AS INTEGER) V FROM "#table_partitions"
    WHERE TABLE_NAME='myIntervalPartition2' ORDER BY V;
      
    PARTITION_BOUNDARY_VALUE
    -----------------------------------
    -5000
    15000
    35000
    55000
      :

View information

View information can be obtained.

Table name

#views

Schema

Column nameItemType
DATABASE_NAMEDatabase nameSTRING
VIEW_NAMEView nameSTRING
VIEW_DEFINITIONView defining character stringSTRING

Information about an SQL in execution

The information about SQL , a query or a job, under execution can be obtained.

Table name

#sqls

Schema

Column nameItemType
DATABASE_NAMEDatabase nameSTRING
NODE_ADDRESSaddress of the node being processed (system)STRING
NODE_PORTThe port of the node being processed (system)INTEGER
START_TIMEProcessing start timeTIMESTAMP
APPLICATION_NAMEApplication nameSTRING
SQLQuery character stringSTRING
QUERY_IDQuery IDSTRING
JOB_IDJob IDSTRING

Information about an event in execution

The information about the event under execution can be obtained.

Table name

#events

Schema

Column nameItemType
NODE_ADDRESSaddress of the node being processed (system)STRING
NODE_PORTThe port of the node being processed (system)INTEGER
START_TIMEProcessing start timeTIMESTAMP
APPLICATION_NAMEApplication nameSTRING
SERVICE_TYPEService type (SQL/TRANSACTION/CHECKPOINT/SYNC)STRING
EVENT_TYPEEvent types (PUT/CP_START/SYNC_START etc.)STRING
WORKER_INDEXThread number of a workerINTEGER
CLUSTER_PARTITION_INDEXCluster partition numberINTEGER

Connection information

The information about the connected connection can be obtained.

Table name

#sockets

Schema

Column nameItemType
SERVICE_TYPEService type (SQL/TRANSACTION)STRING
SOCKET_TYPESocket typeSTRING
NODE_ADDRESSConnection source node address (viewed from a node)STRING
NODE_PORTConnection source node port (viewed from a node)INTEGER
REMOTE_ADDRESSConnection destination node address (viewed from a node)STRING
REMOTE_PORTConnection destination node port (viewed from a node)INTEGER
APPLICATION_NAMEApplication nameSTRING
CREATION_TIMESocket generation timeTIMESTAMP
DISPATCHING_EVENT_COUNTTotal number of times to start request for event handlingLONG
SENDING_EVENT_COUNTTotal number of times to start event transmissionLONG

the socket types are as follows.

ValueDescription
SERVERTCP connection between servers
CLIENTTCP connection with a client
MULTICASTMulticasting socket
NULLIn case currently unidentified during the cases such as connection attempt

Examples

Only in case of TCP connection with a client (socket type: CLIENT), it can be determined whether the connection is waiting for execution.

Specifically, if DISPATCHING_EVENT_COUNT is larger than SENDING_EVENT_COUNT, it can be determine that the possibility is relatively high that the time waiting for execution existed.

sh
SELECT CREATION_TIME, NODE_ADDRESS, NODE_PORT, APPLICATION_NAME FROM "#sockets"
WHERE SOCKET_TYPE='CLIENT' AND DISPATCHING_EVENT_COUNT > SENDING_EVENT_COUNT;

CREATION_TIME             NODE_ADDRESS   NODE_PORT  APPLICATION_NAME
--------------------------------------------------------------------
2019-03-27T11:30:57.147Z  192.168.56.71  20001      myapp
2019-03-27T11:36:37.352Z  192.168.56.71  20001      myapp
          :