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:
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:
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:
Name  | Type  | Description  | 
|---|---|---|
sql  | String  | SQL query executed.  | 
operation  | String  | Type of SQL query.  | 
submit  | Integer  | Number of tasks submitted to execute the query.  | 
finished  | Integer  | Number of tasks finished.  | 
date  | Timestamp  | Execution date of the query in a Unix timestamp.  | 
error  | String  | Error message if the query fails.  | 
killable  | Boolean  | True if the query is killable.  | 
killed  | Boolean  | True if the query has been killed.  | 
user  | String  | User who runs the query.  | 
ip  | String  | IP Address of the user executing the query.  | 
run  | Boolean  | True if the query is running.  | 
cached  | Boolean  | True if the query comes from the cache.  | 
delegated  | Boolean  | True if the query has been delegated to an external system.  | 
elapsed  | Integer  | Execution time of the query, in ms.  | 
max_worker_memory  | Integer  | Amount of memory used on maximum to compute the query before aggregation, on bytes.  | 
request_master_memory  | Integer  | Amount of memory used by the master to aggregate result, on bytes.  | 
read_lines_from_buckets  | Integer  | Number of lines read from bucket for the query.  | 
disk_usage  | Integer  | Amount of disk space used if the query has spilled on disk.  | 
indexInformations.tableName  | String  | Name of the index used to execute this query.  | 
indexInformations.computedJoins  | Integer  | Number of computed joins.  | 
indexInformations.cols.name  | String  | Name of the column in the index used.  | 
indexInformations.cols.hit  | Integer  | Each time this column has been referenced in the query.  | 
pending  | Boolean  | True is the query is in pending state (waiting for an execution slot), false otherwise.  | 
pending_duration  | Integer  | Total time (ms) while the query was in a pending state.  | 
has_spill  | Boolean  | True is the query used the spill-to-disk feature, false otherwise.  | 
freezing  | Boolean  | True 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_duration  | Integer  | Total time (ms) while the query was in a freezing state.  | 
bigindex  | Boolean  | True 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:
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