PostgreSQL Performance Glossary
Complete dictionary of PostgreSQL performance terms, metrics, and concepts with practical examples and detailed explanations.
A
ACID
A set of properties that guarantee database transactions are processed reliably: Atomicity, Consistency, Isolation, and Durability.
Autovacuum
PostgreSQL's automatic maintenance process that reclaims storage and updates statistics by removing dead tuples and updating the visibility map.
autovacuum = on
Related:
autovacuum_naptime
, autovacuum_vacuum_threshold
B
Buffer Pool
In-memory cache that stores frequently accessed data pages to reduce disk I/O operations. Controlled by the shared_buffers
parameter.
Monitoring: Check
pg_stat_bgwriter
for buffer hit ratio.
Btree Index
The default index type in PostgreSQL, optimized for equality and range queries. Maintains sorted order and supports various data types.
CREATE INDEX idx_name ON table (column);
Best for: WHERE clauses, ORDER BY, and range queries.
C
Checkpoint
A process that ensures all dirty buffers are written to disk and creates a recovery point. Critical for crash recovery and performance tuning.
checkpoint_timeout
- Maximum time between checkpointscheckpoint_completion_target
- Spread checkpoint I/O over time
Connection Pooling
Technique to manage database connections efficiently by reusing existing connections rather than creating new ones for each request.
Modes: Session, transaction, statement pooling
P
pgbench
PostgreSQL's built-in benchmarking tool for running performance tests. Simulates TPC-B workload by default but supports custom scripts.
pgbench -c 10 -t 1000 dbname
Metrics: TPS, latency, connection times
Planner
PostgreSQL's query optimizer that determines the most efficient execution plan for SQL queries based on statistics and cost estimates.
EXPLAIN (ANALYZE, BUFFERS) SELECT ...
Key Concepts: Cost estimation, join algorithms, index selection
Q
Query Plan
The execution strategy chosen by the planner for a SQL query, showing the sequence of operations and their estimated costs.
Optimization: Add indexes, rewrite queries, update statistics
T
TPS (Transactions Per Second)
A key performance metric measuring the number of database transactions completed per second. Higher TPS indicates better performance.
Factors: Hardware, configuration, query complexity, concurrency
Tuple
PostgreSQL's term for a row in a table. Due to MVCC, multiple versions of the same logical row may exist as different tuples.
Cleanup: VACUUM removes dead tuples and reclaims space
V
VACUUM
Maintenance operation that removes dead tuples, updates statistics, and reclaims storage space. Essential for PostgreSQL performance.
Automation: autovacuum handles routine maintenance
W
WAL (Write-Ahead Logging)
PostgreSQL's crash recovery mechanism that ensures data durability by writing changes to a log before modifying data pages.
Configuration:
wal_level
, max_wal_size
Work_mem
Memory allocated for internal sort operations and hash tables before writing to temporary disk files. Critical for query performance.
Tuning: Start with 4MB, monitor for disk-based operations