Hung Nguyen <hungnq1989(at)gmail(dot)com> writes:
> I'm not sure if this is really a bug, but its' super weird if the query
> planner favors the trigram index over the b-tree index for joining is not
> optimal to me. Thank you so much.
I agree that sounds bad, but you've provided a conclusion with no
supporting evidence, making it impossible to investigate. A
self-contained test case that behaves this way would be ideal.
Otherwise, please see
https://wiki.postgresql.org/wiki/Slow_Query_Questions
and provide the info suggested therein.
regards, tom lane