After you have built and installed it, you add a couple of settings to the postgresql.conf file, like this:
Then if the planner estimates the cost as higher than the statement_cost_limit it will raise an error rather than allowing the query to run.shared_preload_libraries = 'plan_filter' plan_filter.statement_cost_limit = 100000.0
This module follows an idea from a discussion on the postgresql-hackers mailing list some time ago. It was developed by PostgreSQL Experts Inc for our client Twitch.TV, who have generously allowed us to make it publicly available.
How can you define what's the cost limit more adapt for your needs? Also I cannot find in EXPLAIN docs how reliable is this information. Could you clarify please?
ReplyDeleteThank you.
That's beyond the scope of this. Consult the postgres docs and mailing lists.
DeleteCan you specify the value per session instead of in the config?
ReplyDeleteYes, you can. You can also set it per user, or per database.
DeleteHello Andrew,
ReplyDeleteCan you please give me more details of this, how to Install and how to implement this ? I have tried this as suggested in https://github.com/pgexperts/pg_plan_filter. But still I'm not able to implement this. Please help me
Without details it's impossible to say what you did wrong. Were you able to build and install it? If not, what went wrong? If you were able to, then what is not working?
ReplyDelete