Databases · Senior · Question 32 of 75
What problem can prepared statements with generic plans cause?
- ✓Correct answer: After several executions PostgreSQL may switch to a generic plan that ignores the actual parameter values, which is bad for skewed data
- 2They allow SQL injection
- 3Prepared statements can't use indexes
Explanation
plan_cache_mode = force_custom_plan forces per-value planning when needed. Most of the time generic plans save planning time.