Problem
Users can accidentally execute high-cardinality queries (e.g., FullScan/TableLookUp on large tables) directly in production databases via the UI, causing performance degradation or outages.
Proposed Solution
Implement a pre-execution safety check:
- Run
EXPLAIN to estimate query cardinality and resource impact
- If high-risk conditions are detected and target is production DB:
- Show prominent modal warning with text:
"This query may severely impact database performance. I understand the risks and wish to proceed."
- Require explicit user confirmation (checkbox + button)
- Criteria for triggering:
- Full table scans on large datasets
- Missing shard keys in filters
- High estimated row processing