We had a case recently where a database view (PostgreSQL) was "optimized." And in fact, it made quite a bit of difference in the normal case. But in one particular situation, the planner ended up with a much worse plan. We didn't catch the problem until it was in production.
Is there any way to keep track of the planner statistics (in development environments) and raise an assertion if the plan cost exceeds some specified threshold?
IOW, if we know a query plan cost has an upper limit of, say, 37033 normally, I'd like to be alerted if that planner result changes materially (e.g., if the cost jumps to 60k).
I'm looking for an approach that's largely automatic, so we don't need to run "EXPLAIN" queries manually. I'm familiar with DBI's trace stuff, but I didn't see anything there that would help with this.
Thanks.
In reply to DBI and keeping track of planner statistics by mla12
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |