3 ms·
Surely you give up LIKE queries benefiting from the index this way?
by quickthrower2 4y ago
Surely you give up LIKE queries benefiting from the index this way?
- necovek 4y agoLast time I needed this, LIKE queries still did sequential scans anyway, so the presence of an index or not did not matter. Also note that you can have multiple indexes in Postgres (well, any RDBMS). For emails in particular, you can even do partial indexes (eg. imagine filtering emails on @gmail.com to hit a separate index that's only half of your full table index). This requires some care with queries, but a wonderful feature regardless.
- tpetry 4y agoWith a trigram index in PostgreSQL you can even do index-supported leading wildcard searches.