-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hint table doesn't seem to have effect on query plans #183
Comments
FWIW, upon a hint that the
|
Further analyzing this, I see the hint table is visited:
but there is no row found matching my query. My guess right now is that I don't fully understand how to come up with the norm query. |
So, after further experimenting, we've found the following:
Based on all that, I think the query normalization approach has to be changed. It would be rather helpful if query strings from |
There is a query id mechanism that got spun off pg_stat_statements and is now usable by other subsystems, I'd think pg_hint_plan should use that as well. |
Had/have the same issue. SELECT hints FROM hint_plan.hints WHERE norm_query_string = $1 AND ( application_name = $2 OR application_name = '' ) ORDER BY application_name DESC |
Yeah, we really need to rip the query normalization entirely off pg_hint_plan and grab all the information we need from the query IDs. I've not been able to get down to do it, though. So if somebody would like to write a patch I could check, that would be welcome. |
This stuff will be addressed by #190 as an item for the next release, and will not be backpatched to stable branches, so closing this issue for now to avoid a duplicate. |
I've got the following table:
pg_hint_plan is set up like this:
With these settings, I can do the following:
So far, so good.
Now I inserted the following into the hint table:
As far as I can tell the norm query string matches my query, but there is still no hint being applied:
What am I doing wrong? And how to debug this further?
The text was updated successfully, but these errors were encountered: