Postgres uses a process-based architecture. Rather than using threads, necessary information is shared among sessions via shared memory (diagram, slide 12). This allows for:
- Simplified backend code
- Efficient scheduling of multiple sessions across multiple CPUs by the operating system
- Improved reliability
Unfortunately, this process architecture makes it difficult for a single session to utilize multiple CPUs and I/O channels. (Multiple sessions use multiple CPUs just fine.) This is becoming more of a limitation because of recent computer architectural improvements:
- More CPU cores rather than faster CPUs
- Increased memory capacity
- Solid-state drives with reduced I/O latency