pg_hint_plan
pg_hint_plan copied to clipboard
parallel and indexscan must be used together for parallel index scan
it seems Parallel() must be given with IndexScan() to let PostgreSQL use parallel index scan. not sure if it's true though feel it's right by reading the source code and if actually it is so then it should be on the manual or somewhere obvious.
version: pg10, 1.3.*
ex. /*+ IndexScan(tb idx_tb) */
- when the planner chose to use parallel query, just giving IndexScan() hint doesn't make it use index scan
- if the planner doesn't chose to use parallel, there is no problem. it uses index scan.
/*+ Parallel(tb 2 hard) IndexScan(tb idx_tb) */
- giving Parallel() hint together make it actually use index scan
- OR should give Parallel(tb 0 hard) to make sure it accidentally chose parallel and uses seq scan.
There was a bug that indexpats are not recreated without parallel hints. The following commit will fix that. Please could you check it?
https://github.com/ossc-db/pg_hint_plan/commit/26d0decb8dbb4b75595baafcaca6cab48c0da1c0
I and STakahiro confirmed the patch fixes the problem. Thanks. (And, sorry for late feedback)
Note for future readers, afaict this fix was released in 1.3.5