ossc-db / pg_hint_plan

Extension adding support for optimizer hints in PostgreSQL
Other
674 stars 101 forks source link

multiple indexes for hints? #155

Closed mahdiyari closed 10 months ago

mahdiyari commented 10 months ago

Hi, How can I provide multiple indexes as the hint? Is this the correct form? Sometimes the query has one parameter less which makes the used index invalid for this query.

/*+ IndexOnlyScan(table index1 index2) */
michaelpq commented 10 months ago

Reading the docs explain the features: https://pg-hint-plan.readthedocs.io/en/latest/hint_list.html

In this case, IndexOnlyScan is able to use a list of indexes:

IndexOnlyScan(table[ index...])
mahdiyari commented 10 months ago

So the syntax above is correct. There was no examples so I did doubt how would the list look like. Thanks.

michaelpq commented 10 months ago

Patches to improve the documentation are always welcome :)