EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) SELECT ...;SELECT tablename,attname,n_distinct,correlation FROM pg_stats WHERE tablename=...ANALYZE fact_events;ALTER TABLE fact_events ALTER COLUMN region SET STATISTICS 500;CREATE STATISTICS stat_region_date ON region,event_date FROM fact_events;SET enable_nestloop=off; SET enable_seqscan=off;SET random_page_cost=1.1; SET effective_cache_size='24GB';SELECT * FROM pg_stat_user_tables WHERE relname='fact_events';Vertex Analytics runs PostgreSQL 16 for real-time dashboards on a 200M-row fact table. The query planner is making catastrophically wrong decisions: choosing nested loop joins on 80M-row tables, ignoring partial indexes, and picking sequential scans despite excellent indexes. No hints allowed initially: diagnose WHY the planner is wrong (stale statistics, incorrect row estimates, correlation issues), fix the root cause, then use planner hints only as a last resort.
-- comment or REPORT statement