Query tuning in Amazon Redshift means inspecting, rewriting, and configuring SQL so statements finish faster and use fewer cluster resources.
Query tuning is the process of examining SQL execution plans, table design, and cluster configuration to minimise runtime and cost. You identify bottlenecks, rewrite statements, and adjust WLM queues to match workload needs.
Query monitoring tables—SVL_QLOG, STL_EXPLAIN, and SVL_QUERY_SUMMARY—list duration, rows scanned, and steps. Filter by highest query_cpu_time to isolate expensive statements.
Run EXPLAIN on your SQL.Look for large DS_BCAST_INNER or DS_DIST_ALLNONE steps signalling data redistribution. Reduce them with DISTKEYs, JOIN changes, or predicate pushdown.
Unrestricted SELECT *, cross-region joins, LIKE '%text%' filters, row-by-row correlated subqueries, and missing predicates cause large scans and network shuffles.
Co-locate join columns with identical DISTKEYs or DISTSTYLE ALL on small dimension tables.Add SORTKEYs on frequently filtered columns to prune blocks quickly.
Keep result caching on for dashboards with identical parameters. Disable per session with SET enable_result_cache_for_session TO off when testing or ingesting near-real-time data.
Create separate queues for ETL, ad-hoc, and reporting queries.Allocate enough slots to ETL but cap concurrency for heavy joins to prevent cluster saturation.
Use EXPLAIN and ANALYZE regularly, re-write predicates, align DIST/SORT keys with joins and filters, VACUUM & ANALYZE after large loads, and monitor SVL views.
.
Yes—ANALYZE updates table statistics so the optimizer chooses the best join strategy. Run it after significant INSERT, COPY, or DELETE operations.
No. DISTSTYLE ALL duplicates a table on every node, great for small dimensions but wasteful on large fact tables.
Often. Rewriting queries and adjusting keys solves most issues before spending on extra nodes.