pg_plan_guarantee icon indicating copy to clipboard operation
pg_plan_guarantee copied to clipboard

Compare parse trees instead of query strings

Open danolivo opened this issue 2 years ago • 0 comments

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.

danolivo avatar Jan 25 '24 03:01 danolivo