Skip to content

Queries History ​

Queries API allows you to retrieve SQL queries executed on your cluster.

Retrieve queries count ​

GET /api/monitor/get/query/count/:start/:end

This endpoint retrieve the number of queries starting between :start and :end timestamps.

Example:

text
curl http://myindeximacluster:8082/api/monitor/get/query/count/1667075793000/1667075937000 \
  -H "Authorization: $ACCESS_TOKEN" \
  -H "Monitor-Target-Host: indexima-core-1" \
  -H "Monitor-Target-Port: 9999" \
  --compressed -s | jq

Retrieve queries listing ​

GET /api/monitor/get/query/desc/:start/:end/:limit

GET /api/monitor/get/query/asc/:start/:end/:limit

This endpoint retrieve all queries starting between :start and :end timestamps.
Queries will be ordered ascending with /get/query/asc or descending with /get/query/desc .
The timestamps for :start and :end are unix timestamps in milliseconds.
The parameter :limit is the maximum number of queries to retrieve.
The sql field, containing the sql statement, is truncated to 100 characters in this endpoint. Use /api/query/sql endpoint to retrieve the complete statement.

Example:

text
curl http://myindeximacluster:8082/api/monitor/get/query/desc/1667075793000/1667075937000/2 \
  -H "Authorization: $ACCESS_TOKEN" \
  -H "Monitor-Target-Host: indexima-core-1" \
  -H "Monitor-Target-Port: 9999" \
  --compressed -s | jq

Reply JSON format:

NameTypeDescription
sqlStringSQL query executed.
operationStringType of SQL query.
submitIntegerNumber of tasks submitted to execute the query.
finishedIntegerNumber of tasks finished.
dateTimestampExecution date of the query in a Unix timestamp.
errorStringError message if the query fails.
killableBooleanTrue if the query is killable.
killedBooleanTrue if the query has been killed.
userStringUser who runs the query.
ipStringIP Address of the user executing the query.
runBooleanTrue if the query is running.
cachedBooleanTrue if the query comes from the cache.
delegatedBooleanTrue if the query has been delegated to an external system.
elapsedIntegerExecution time of the query, in ms.
max_worker_memoryIntegerAmount of memory used on maximum to compute the query before aggregation, on bytes.
request_master_memoryIntegerAmount of memory used by the master to aggregate result, on bytes.
read_lines_from_bucketsIntegerNumber of lines read from bucket for the query.
disk_usageIntegerAmount of disk space used if the query has spilled on disk.
indexInformations.tableNameStringName of the index used to execute this query.
indexInformations.computedJoinsIntegerNumber of computed joins.
indexInformations.cols.nameStringName of the column in the index used.
indexInformations.cols.hitIntegerEach time this column has been referenced in the query.
pendingBooleanTrue is the query is in pending state (waiting for an execution slot), false otherwise.
pending_durationIntegerTotal time (ms) while the query was in a pending state.
has_spillBooleanTrue is the query used the spill-to-disk feature, false otherwise.
freezingBooleanTrue is the query is in freezing state (the query is started and flagged as big-request and waiting for a big-request slot) false otherwise.
freeze_durationIntegerTotal time (ms) while the query was in a freezing state.
bigindexBooleanTrue is the query used the bigindex feature, false otherwise.

SQL Operations

The following list describes all the SQL operations available : SELECT / LOAD / CREATE / INSERT / DELETE / DROP / TRUNCATE / SHOW_MEMORY / SHOW_TABLECOUNT / SHOW_DICTIONARIES / COMMIT / ROLLBACK / PAUSE / DESCRIBE / ALTER_DDL / ADD_INDEX / DROP_INDEX / SYNCHRONIZE / SET / CREATE_SCHEMA / DROP_SCHEMA / USE / EXPORT / IMPORT / CREATE_VIEW / DROP_VIEW

Retrieve query complete statement ​

GET /api/monitor/get/query/sql/:start/:identifier

This endpoint retrieve the complete SQL statement for a specific query. The service requires to precise the timestamp_start of the query to uniquely identify it (as query identifier are reseted upon service restart).

Example:

text
curl http://myindeximacluster:8082/api/monitor/get/query/sql/1667075932624/64 \
  -H "Authorization: $ACCESS_TOKEN" \
  -H "Monitor-Target-Host: indexima-core-1" \
  -H "Monitor-Target-Port: 9999" \
  --compressed -s | jq