Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Top 10 database optimization tips

128 views

Published on

Implementing these top 10 database optimization tips will help in improving performance and productivity.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Top 10 database optimization tips

  1. 1. i. Understand your application workload ii. Choose the right hardware iii. Select proper file system iv. Benchmark your environment v. Tune your Postgres Server vi. Perform Log Auditing vii. Understand your query plan viii. Tune your queries ix. Implement proper indexing x. Run / Schedule Maintenance jobs Top 10 Tips for Database Optimization
  2. 2. TIP 1 Understand Your Application Workload  How your application is interacting with your database.  Is your application read intensive or write intensive  ETL jobs.  Reporting and Analytical queries
  3. 3. CPU  Which Processor Family?  More Cores Vs Faster Cores. RAM  It depends on Size of working data set. I/O  Disk and Disk bandwidth. Network  Lag time / Bandwidth TIP 2 Choose the Right Hardware
  4. 4. Pg_buffercache
  5. 5.  What is your storage stagey? SATA VS SCSI DAS VS SAN  RAID POLICY  RAID CONTROLLER SETTINGS  Monitor o/p of iostat  Distribute DB objects across Tablespaces  Maintain Separate Disk for pg_xlog Storage
  6. 6.  Journaling file systems. Ext3  Ext4  Xfs TIP 3 Select proper File System
  7. 7. TIP 4 Benchmark Your Environment  CPU: PassMark, Sysbench  RAM: memtest, cachebench  I/O: bonnie++, dd  Network: bwping, netperf  DB: pgBench, Sysbench Hardware and Database Tests:
  8. 8.  max_connections  shared_buffers Effective_cache_size Work_mem Maintenance_work_mem TIP 5 Tune Your PostgreSQL Server Experiment with Best Values
  9. 9. TIP 6 Perform Log Auditing Enable slow running queries in PostgreSQL :  Log_min_duration_statement  Pg_stat_statements  Pgbadger,EPOA  Auto-explain
  10. 10. TIP 7 Understand your Query Plan  EXPLAIN Command  Scan Methods  Join Methods
  11. 11. Query Plan
  12. 12. TIP 8 Tune your queries  Performance Tips  Indexes  WHERE clause  JOINs
  13. 13. TIP 9 Implement Proper Indexing  Indexes  Partial Indexes  Expression Indexes  Unique Indexes  Multi-column Indexes  Managing / Maintaining Indexes  Unused Indexes and Index bloat
  14. 14. TIP 10 Run / Schedule Maintenance Jobs  PostgreSQL Vacuum & Analyze  Maintenance & Performance

×