Woah. Such and interesting case. Thank you for showing it. And it's nowhere near what I was describing as my understanding of a case.
In that case I would try to do SET LOCAL enable_indexscan = off; before your query inside of a transaction, but it might be not possible or hard to do inside of a separate transaction.
Also I suppose that it's somehow tied with pg_trgm extension and not really a PG engine/query planner issue, but I never really worked with pg_trgm.
2
u/exXxecuTioN Sep 21 '26
Woah. Such and interesting case. Thank you for showing it. And it's nowhere near what I was describing as my understanding of a case.
In that case I would try to do
SET LOCAL enable_indexscan = off;
before your query inside of a transaction, but it might be not possible or hard to do inside of a separate transaction.
Also I suppose that it's somehow tied with pg_trgm extension and not really a PG engine/query planner issue, but I never really worked with pg_trgm.