Database tuning guide for PostgreSQL, MySQL, SQL Server and Oracle
A field guide to making relational databases fast and keeping them that way: from the first look at a slow system, through the evidence, the fixes and the settings, to the baselines and monitoring that stop the same problem coming back. Read it here, chapter by chapter, or download the PDF.
Contents
- 1. How to start
- 2. Set up your toolkit
- 3. Build a data profile
- 4. Choose the right platform for the data
- 5. Decide what to look for
- 6. The statement tuning procedure
- 7. Tuning joins and WHERE clauses
- 8. Indexing: when, where, which type, and what goes wrong
- 9. Optimizing procedure code
- 10. Materialized views and partitioning
- 11. Settings: match the workload, then keep it there
- 12. Baselining: our approach and why it matters
- 13. Ongoing observability
- 14. How ReinDB fits in
- Appendix A. Checklists
- A.1 First hour on an unfamiliar database
- A.2 Statement tuning
- A.3 Index change
- A.4 Settings change
- A.5 Monitoring starter set
- A.6 Running on a managed service
- Appendix B. Version notes
- B.1 Oracle 11g against 19c
- B.2 SQL Server
- B.3 PostgreSQL
- B.4 MySQL
- Appendix C. Glossary
- Appendix D. Sources and further reading
About this guide
This is a field guide to making relational databases fast and keeping them that way. It follows the path a working DBA takes: from the first look at a slow system, through the evidence, the fixes and the settings, to the monitoring that stops the same problem from coming back.
Who it's for
DBAs, performance engineers, data architects, and developers who own database code. It assumes you can read SQL and an execution plan. It does not assume you know all four engines.
What it covers
PostgreSQL, MySQL, Microsoft SQL Server and Oracle Database, self-managed or as managed cloud services. The main text is engine-neutral: it explains each method in terms that apply to any relational database. Engine differences sit in labeled notes and comparison tables, so you can read straight through, or jump to the notes for the engine you run.
| Part | Chapters | What you get |
|---|---|---|
| Strategy | 1 to 5 | How to start, the toolkit and what changes on managed cloud services, the data profile, platform choices, and what to look at first |
| Hands-on tuning | 6 to 11 | The statement tuning procedure, joins and predicates, indexing, procedure code, materialized views and partitioning, settings |
| Staying fast | 12 to 13 | Baselines and ongoing observability, including Grafana and alerting |
| ReinDB | 14 | How ReinDB fits each step, and how to put it to work |
| Reference | Appendices | Checklists, version notes, glossary and sources |
Conventions
- Versions are noted in parentheses where a feature depends on them, for example (PostgreSQL 13+) or (Oracle 12c+). Appendix B collects the differences that matter most, including Oracle 11g against 19c.
- Examples use a small, familiar schema: customers, orders and order items. They are illustrations, not drop-in scripts. Test every change outside production first, with production-like data.
- Oracle licensing. The Oracle path in this guide uses V$ views and free tools only. Features that need the Diagnostics Pack or the Tuning Pack are marked wherever they come up. Confirm against Oracle's licensing documentation for your release and edition.
- Engine notes. Slate boxes labeled ORACLE, SQL SERVER, POSTGRESQL or MYSQL hold the syntax, views, settings and version details for one engine; ENGINE NOTES boxes cover several at once. Tables with a slate header compare the engines side by side.
- Cloud notes. Teal boxes cover managed services such as Amazon RDS and Aurora, Azure SQL, Google Cloud SQL and Oracle's own cloud services. Section 2.6 sums up what changes in the cloud.
- Other callouts. Green boxes show where ReinDB helps. Amber boxes are warnings and common traps. Grey boxes are side notes.
Trademarks
Oracle and MySQL are registered trademarks of Oracle and/or its affiliates. Microsoft and SQL Server are trademarks of the Microsoft group of companies. PostgreSQL is a registered trademark of the PostgreSQL Community Association. Other names may be trademarks of their respective owners. ReinDB is a trademark of Bandlei, Inc.
© 2026 Bandlei, Inc., Evergreen, Colorado.