From: Hung Nguyen <hungnq1989(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject:
Date: 2022-07-02 12:15:55
Message-ID: CABs3KGQnOkyQ42-zKQqiE7M0Ks9oWDSee=+Jx3-TGq=68xqWYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hellom

<https://dba.stackexchange.com/posts/314015/timeline>

I've just upgraded my postgres instance from v11 to v14. There was an
interesting problem because we have a trigram index on order_id column.

This new feature makes our simple join query on that column very slow. For
example:

SELECT count(*) from order_rows o1 join order o2 on o1.order_id = o2.order_id

To solve this problem the existing trigram index must be dropped and we
cannot use ILIKE queries on this column. I just wonder if there is any way
to tell postgres what index (in this case btree index) to use when doing
the join operations?

[Postgres 14] Allow GiST/GIN pg_trgm indexes to do equality lookups (Julien
Rouhaud)

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.

References

- https://www.postgresql.org/docs/current/release-14.html
- https://www.postgresql.org/docs/11/pgtrgm.html

Responses

  • Re: at 2022-07-02 13:45:31 from Tom Lane
  • Re: your mail at 2022-07-02 13:49:16 from Julien Rouhaud

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-07-02 13:45:31 Re:
Previous Message David Johansen 2022-07-02 04:34:13 Re: Auto-vacuum timing out and preventing connections