pg_hint_plan
pg_hint_plan copied to clipboard
Ignore hints in prepared statements with array arguments
Case to reproduce: We have an issues with prepared statements that use arrays in arguments. In this case pg_hint_plan don't pass preceding sql check. Is it possible to adds '[', ']' symbols into the white list?
prepare test_query(numeric[]) as /*+ MergeJoin(t1 t2) */ with test as (select 1 as x) select t1.* from test t1, test t2 where t1.x=any($1) and t1.x = t2.x;
explain execute test_query(array[1,2,3]);
-- MergeJoin hint will be ignore because of numeric[]
deallocate test_query;
Dear @horiguti can you review the issue please Questions are welcome
@Anisimov-ds @rattrayalex @Fzhlib I see that you have committed in this repository. Do you know what contributor can I contact for a discussion or review?
As you can see from my PR, it was many months before it was reviewed and merged. This is not unheard of in open source.
The person who merged it was @horiguti but I would advise patience 🙂
Related pull request: https://github.com/ossc-db/pg_hint_plan/pull/98
Sorry for the time it took to reply back. I am going to review what you have here. It does not look like a bad idea in itself, still I am wondering about one thing. Shouldn't we treat this as a new feature? From what I can see, this may imply a behavior change for existing users, which may not be wise to backpatch into existing releases.
@rjuju, @MasahikoSawada, @horiguti, please feel free to share your thoughts or just contradict me.
Backpatching it seems a bit scary to me. So +1 to treat this as a new feature.