pg_plan_guarantee
pg_plan_guarantee copied to clipboard
Compare parse trees instead of query strings
thanks for your efforts, As I see, you use query string comparisons as a criteria that the stored plan matches incoming query. I think it is a bad idea. Do you remember that rewrite rules could change? If someone changed definition of a VIEW, query text would be the same, but plan is totally different. IMO, the only criteria is parse tree comparison and you should save both: plan and parse tree. Also, remember indexes. Before returning the plan you need to check existence of all indexes invloved.