Database performance lab for PostgreSQL, MySQL, SQL Server, and Oracle.
The repo runs the same simplified fintech schema on four database engines. The queries are intentionally similar so execution plans can be compared without changing the business problem each time.
The interesting part is not the final timing by itself. The plan tells you when a query changes from a scan to a seek, when an index is ignored, when a sort disappears, or when two engines make different choices for the same query shape.
- PostgreSQL 16
- MySQL 8
- SQL Server 2022
- Oracle Database Free 23c
The schema is based on a small digital wallet and payments system.
- users
- wallets
- beneficiaries
- merchants
- payments
- transactions
- ledger_entries
- audit_logs
Point lookup by wallet number.
Recent transactions for a customer wallet.
Successful payment totals grouped by merchant.
Transaction count and amount grouped by day.
Transaction amounts compared with ledger entries.
Recent audit events filtered by entity and action.
database-performance-lab/
├── postgresql/
├── mysql/
├── sqlserver/
├── oracle/
├── docs/
├── diagrams/
└── docker-compose.yml
docker compose up -ddocker psDefault ports:
| Database | Port |
|---|---|
| PostgreSQL | 5432 |
| MySQL | 3306 |
| SQL Server | 1433 |
| Oracle | 1521 |
The credentials are defined in docker-compose.yml.
- Load schema
- Load sample data
- Run the query before adding indexes
- Capture execution plans
- Apply indexes
- Refresh database statistics
- Run the same query again
- Compare results
- Query Execution Plans
- Indexing Strategies
- Optimizer Statistics
- Join Performance
- Aggregation Performance
- Date Range Queries
- Audit Log Searches
- Fintech Query Patterns
- Schema Diagram
- Experiment Flow
- Query Scenarios
- Experiment Design
- Experiment Results
- Engine Comparison
- Performance Parameters
This project is licensed under the MIT License.
See the LICENSE file for details.