DjangoCon 2011
PostgreSQL is effectively the default RDBMS for Django. Learn the dark arts of optimizing this powerful database to be blazingly fast on your own hardware or in the cloud. This conference talk from 2011 by Frank Wiles of REVSYS presents a comprehensive guide to PostgreSQL performance optimization, emphasizing practical techniques for improving database speed and efficiency. The presentation covers fundamental principles like measuring performance before and after changes, aggressive caching strategies, and monitoring query counts, while also diving into specific tuning parameters such as shared_buffers, effective_cache_size, and work_mem. Wiles addresses hardware considerations including the importance of RAM, disk configuration (favoring RAID-1+0 over RAID-5), and the benefits of separating WAL files onto dedicated storage, while also covering Django-specific optimization techniques like proper use of select_related(), avoiding queries in loops, and implementing proper indexing strategies. The talk concludes with advanced "dark arts" techniques including table partitioning, materialized views, and custom replication solutions, making it a thorough resource for developers and database administrators looking to maximize PostgreSQL performance in web applications.