Skip to main content

Query History Field Table

Starting with Kylin 5.0, the system uses RDBMS to store query history. And each metadata will store two tables related to query history:

  • query_history : information for each query
  • query_history_realization : each index that hit by query

query_history table

Field NameDescription
idauto increment primary key
cache_hitwhether the query hits the cache
durationduration of query execution
engine_typefour query objects, the blue name indicates the query hits model (index group), HIVE indicates that the query is pushed down to Hive, CONSTANTS indicates the query constant, and the blank indicates that the query failed.
error_typeerror message when error occurs during query execution
serverif hostname exists, use hostname of query node, otherwise use IP address of query node
index_hitwhether the query hits index or not
is_agg_index_usedwhether the query hits the aggregate index or not
is_table_index_usedwhether the query hits table index or not
is_table_snapshot_usedwhether the query hits the dimension table
monththe month in which the query is submitted, which is needed to count the history of the query by month.
query_first_day_of_monththe initial time of the month in which the query time is located. This field is required when statistically querying the history by month
query_first_day_of_weekthe initial time of the week in which the query time is located. This field is required when statistically querying the history by month
query_daythe initial time of the day in which the query time is located. This field is required when statistically querying the history by month
query_idquery identity
query_statustwo query statuses, SUCCEEDED indicates that the query was successful, FAILED indicates that the query was abnormal
query_timequery start time
realizationsa string concatenated by the model ID number, Layout ID number, and index type,which format is modelId#layoutId#indexType
result_row_countnumber of query results
sql_textSQL statement that was submitted
sql_patternthe sql pattern of SQL statement that was submitted . This field is needed when sql is accelerated.
submitterKyligence Enterprise user who submits the query
total_scan_bytestotal scanned lines of the query
total_scan_counttotal scanned bytes of the query
project_nameproject name
reserved_field_1reserved field, currently unused
reserved_field_2reserved field, currently unused
reserved_field_3Starting from 4.2, this field is used to record the reason why the index cannot be recommended
reserved_field_4reserved field, currently unused

query_history_realization table

Field NameDescription
query_timeunix timestamp of query start time (when query start to execute)
durationduration of query execution
index_typethree index types, Table Index for table index, Agg Index for aggregate index, and Table Snapshot for dimension table
layout_idID of layout
modelID of model
query_idID of query
project_nameProject name