Query Tracing Configuration
Overview
SingleStore query tracing helps identify slow queries in production by capturing execution details for queries above a duration threshold.
Our Standard Configuration
Check Current Config
-- See current config
SELECT * FROM information_schema.MV_TRACE_EVENTS_STATUS;
Update Configuration
Two-step process to update tracing:
-- 1. Delete current config
DROP EVENT TRACE Query_completion;
-- 2. Set new config (our production standard: 750ms threshold)
CREATE EVENT TRACE Query_completion WITH (
Query_text = on,
Duration_threshold_ms = 750,
Trace_all_failed_executions = on
);
Environment-Specific Thresholds
- Production:
750ms- captures problematic queries without noise - Staging:
250ms- more detailed tracing for testing - Development:
100ms- comprehensive tracing for debugging
Parameters
Query_text = on- Captures actual SQL for debuggingDuration_threshold_ms = 750- Only trace queries slower than 750msTrace_all_failed_executions = on- Always capture failed queries regardless of duration