ossc-db / pg_hint_plan

Extension adding support for optimizer hints in PostgreSQL
Other
696 stars 103 forks source link

Added ability to ignore unrecognized hints instead of rasing error #99

Closed WinterUnicorn closed 1 year ago

WinterUnicorn commented 2 years ago

We have hints that are used by another extension or hints that are used by an external applications(outside of the database layer). We also have cases when some queries using hints from future versions of pg_hint_plan that are not yet supported in the current version. For example we don't have the "memoize" hint in Postgres 13 but some queries already use this hint because that queries was prepared for a future migration to the Postgres 14.

This feature will add the GUC pg_hint_plan.ignore_unrecognized_hints

The property allows to ignore unrecognized keywords without raising error and continue parsing other hints.

michaelpq commented 1 year ago

I don't think that this is a good idea. For one, it could cause users to think that a hint is actually applied if there is a typo in one of the hints provided. A hard error in such cases is much easier to reason about. This kind of things had better be handled at the application level, IMO.

horiguti commented 1 year ago

This kind of things had better be handled at the application level, IMO. +1

michaelpq commented 1 year ago

I am closing that as won't fix. Thanks @horiguti for the extra opinion!