I am trying to optimize query with the clause:
WHERE LOWER(CAST(\"my_table\".\"id\" as TEXT) LIKE '%456%'
I decided to create a trigram index for it.
CREATE INDEX index_name ON my_table USING gin (id gin_trgm_ops);
But looks like I can't do it for an integer type:
ERROR: operator class "gin_trgm_ops" does not accept data type bigint
Is it possible? Probably some typecast required during index creation...