Database management features require Administrator role access and are available at
/database.Overview
The database management interface provides multiple specialized views for different aspects of database administration:Query Performance
Monitor slow queries, execution times, and optimize query performance.
Connections
Track active database connections, connection pools, and client activity.
Locks & Transactions
Identify blocking queries, deadlocks, and long-running transactions.
I/O & Buffer Stats
Monitor disk I/O, buffer hit ratios, and cache performance.
Index Usage
Analyze index effectiveness and identify missing or unused indexes.
Storage
View table sizes, schema statistics, and storage utilization.
TimescaleDB
Manage time-series hypertables, chunks, and compression.
Backups
Monitor database backups and their sizes.
Interface Controls
Auto-Refresh Configuration
The database interface includes configurable auto-refresh with pause capability:Refresh Logic
Query Performance
The Query Performance tab monitors query execution statistics using PostgreSQL’spg_stat_statements extension.
Key Metrics
Execution Statistics
- Calls: Total number of query executions
- Avg Time: Mean execution time in milliseconds
- Max Time: Maximum execution time observed
- Total Time: Cumulative execution time
Cache Performance
- Cache Hit Ratio: Percentage of data served from cache vs disk
- High ratios (>95%) indicate good cache utilization
Query Filtering
Filter and sort queries to identify performance issues:Performance Indicators
Queries are color-coded by average execution time:Connection Management
The Connections tab shows all active database connections and their states.Connection States
- active: Currently executing a query
- idle: Connected but not executing queries
- idle in transaction: Connection is in an open transaction
- idle in transaction (aborted): Transaction encountered an error
High numbers of “idle in transaction” connections can indicate application issues with transaction management.
Locks & Transactions
Monitor database locks to identify contention and blocking queries.Lock Types
- AccessShareLock: SELECT queries
- RowShareLock: SELECT FOR UPDATE
- RowExclusiveLock: INSERT, UPDATE, DELETE
- ShareUpdateExclusiveLock: VACUUM, CREATE INDEX CONCURRENTLY
- ShareLock: CREATE INDEX
- ExclusiveLock: REFRESH MATERIALIZED VIEW
- AccessExclusiveLock: DROP TABLE, TRUNCATE, ALTER TABLE
Identifying Blocking Queries
The locks view shows which queries are blocked and which queries are blocking them, helping identify deadlock situations quickly.I/O & Buffer Statistics
Monitor disk I/O patterns and buffer cache effectiveness.Key Metrics
Buffer Hit Ratio
Percentage of reads served from memory cache. Target: >95%Low ratios indicate insufficient
shared_buffers configuration.Disk Blocks Read
Number of disk blocks read from storage.High values indicate cache misses and potential I/O bottlenecks.
Blocks Written
Disk blocks written by queries.Track write-heavy operations and potential disk wear.
Temp Files
Temporary files created when memory is insufficient.Frequent temp files indicate need for more
work_mem.Index Usage Analysis
The Index Usage tab helps identify index optimization opportunities.Index Effectiveness
Unused Indexes
Indexes that are never or rarely used waste storage and slow down writes.Consider dropping indexes with zero or very low scan counts.
Missing Indexes
Sequential scans on large tables may indicate missing indexes.Review
seq_scan counts relative to idx_scan counts.Index Recommendations
Whenseq_scan significantly exceeds idx_scan on large tables:
- Review queries accessing that table
- Identify common WHERE clause columns
- Consider adding composite indexes for multi-column filters
- Test index effectiveness before deploying
Storage Management
Monitor database storage utilization across tables and schemas.Storage Metrics
- Table Size: Actual data size
- Index Size: Space used by indexes
- Total Size: Combined table + index size
- Row Count: Approximate number of rows
Storage Optimization
VACUUM
VACUUM
Regular vacuuming reclaims storage from deleted rows:Consider enabling autovacuum for automatic maintenance.
Table Partitioning
Table Partitioning
Large tables benefit from partitioning, especially time-series data.TimescaleDB automatically partitions hypertables into chunks.
Archive Old Data
Archive Old Data
For historical data rarely accessed:
- Export to archive storage
- Delete from active database
- Maintain access via external tables if needed
TimescaleDB Features
The TimescaleDB tab provides management for time-series data.Hypertables
Hypertables are TimescaleDB’s abstraction for time-series tables:- Automatically partitioned into chunks by time
- Chunks can be individually compressed
- Old chunks can be dropped efficiently
- Continuous aggregates for rollups
Compression
Compress older chunks to reduce storage:Retention Policies
Automatically drop old data:Backup Management
The Backups tab displays available database backups.Backup Information
Backup Display
Best Practices
Regular Monitoring
Regular Monitoring
Review database metrics daily:
- Check for slow queries
- Monitor connection counts
- Review lock contention
- Verify backup completion
Query Optimization
Query Optimization
For slow queries:
- Copy the query from the performance tab
- Run
EXPLAIN ANALYZEto understand execution plan - Identify missing indexes or inefficient joins
- Test optimization in staging before production
Proactive Maintenance
Proactive Maintenance
Schedule regular maintenance:
- Weekly VACUUM ANALYZE
- Monthly index rebuilds for high-write tables
- Quarterly storage review and archival
- Regular backup verification
Performance Baselines
Performance Baselines
Establish baselines during normal operation:
- Typical query execution times
- Normal connection counts
- Expected buffer hit ratios
- Standard lock wait times
Capacity Planning
Capacity Planning
Monitor trends over time:
- Database growth rate
- Query volume increases
- Connection pool utilization
- I/O throughput trends
Troubleshooting
High Query Times
- Identify slow queries in Query Performance tab
- Check for missing indexes in Index Usage tab
- Review lock contention in Locks & Transactions tab
- Verify buffer hit ratio in I/O & Buffer Stats tab
Connection Pool Exhaustion
- Review active connections in Connections tab
- Identify long-running queries
- Check for connections stuck in transactions
- Increase connection pool size if needed
Storage Growth
- Review table sizes in Storage tab
- Identify largest tables and growth rate
- Run VACUUM to reclaim deleted row space
- Implement retention policies for time-series data
- Consider archiving old data
Lock Contention
- Review Locks & Transactions tab
- Identify blocking queries
- Terminate blocking sessions if necessary
- Optimize query patterns to reduce lock duration
- Consider table partitioning to reduce lock scope
Related Topics
System Monitoring
Monitor overall platform health
Roles & Permissions
Understand administrator access
Player Sanctions
Manage player moderation