Skip to content

Reduce unnecessary query and data work ​

Start with the reader's required result. Avoid returning unused columns or unlimited rows when the application only displays a small page. A smaller response can reduce transfer and client work, but it does not necessarily reduce every scan performed by SQL.

Use terminal query events to see where work is spent:

sql
SELECT query_id, query_duration_ms, read_rows, read_bytes,
       result_rows, peak_memory_usage
FROM system.query_log
WHERE type = 'QueryFinish'
ORDER BY event_time DESC
LIMIT 10;

Compare equivalent queries on representative data. A targeted index may help frequent lookups; unnecessary indexes also require maintenance during writes. An ordinary view can simplify a shared report definition without storing another copy of its result.

Retain data according to an explicit reader and recovery requirement. Use a reviewed date cutoff for deletion and test the archive or backup before removing source rows. Coordinator DB does not provide a documented billing meter or managed-cloud price schedule, so estimate operational cost from your own environment and observed workload rather than invented per-query prices.

See indexes, retention, copies and request limits.