There is a postgres query using like statement:
email LIKE '%@%domain.com'
What is the most appropriate index type that I can use?
I've found pg_trgm module which must be enabled:
CREATE EXTENSION pg_trgm;
The pg_trgm module provides functions and operators for determining the similarity of ASCII alphanumeric text based on trigram matching, as well as index operator classes that support fast searching for similar strings.
And then you can
CREATE INDEX <index name> ON <table name> USING gin (<column> gin_trgm_ops);
Is there a better option?
gin_trgm_ops is described here: https://niallburkley.com/blog/index-columns-for-like-in-postgres/