How to deal with single-line comment when using pg_hint_plan

31 Views Asked by At

I'm trying to test some query plans using pg_hint_plan through Metabase, which under the hood prefixes the query with a single-line comment, so that the query actually run is something like:

-- Metabase:: userID: 123 queryType: native queryHash: 4567890
explain analyze
/*+ SeqScan(users) */
select id from users where email = 'test@me'

Now, the docs say: "pg_hint_plan reads hints from only the first block comment", implying this should work, but I find that the -- comment prevents pg_hint_plan from doing its thing.

Is there any workaround?

0

There are 0 best solutions below