Dev Tools · 2h ago
PostgreSQL Planner Settings: PREPARE vs EXECUTE Timing Matters
PostgreSQL planner parameters like enable_seqscan affect plan generation, not execution. With prepared statements, the question arises whether settings should apply at PREPARE or EXECUTE time. A simple example shows that settings applied at PREPARE time influence the cached plan, while EXECUTE-time settings are ignored for already-prepared statements.
Meridian48 take
This nuance is critical for DBAs tuning query performance, but the article's toy example may understate real-world complexity with generic plans.
postgresqlquery-planning