In order to make sure Data Platform is working optimally, we suggest you following a couple of best practices:
1. Use results_recent for most queries
It covers the last 3 months and is refreshed every few minutes. Only use results_archived when you need historical data.
2. Filter on indexed columns
Always include process_id and/or run_id in WHERE clauses for results, runs, and exceptions tables.
3. Use LIMIT
For exploratory queries or large result sets, always add a LIMIT clause.
4. Date filtering is optional but recommended
Unlike Impala, Redshift does not require date partitioning. However, date filters on large tables still improve performance.
5. Set search path once
Use SET search_path TO '{tenant}_dataplatform_v1'; at the start of your session to avoid repeating the schema prefix.
6. JOIN to results_custom_fields only when needed
If you don't need custom fields, skip the JOIN for better performance.