PostgreSQL optimization including indexes, query plans, partitioning, JSONB operations, and connection pooling