--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a7b3f669-adfe-4c76-aee4-4a5462aa2ea1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# explain select id, name from some_table where name ~ 'foo';
QUERY PLAN
-----------------------------------------------------------------
Seq Scan on some_table (cost=0.00..1829.67 rows=337 width=22)
Filter: ((name)::text ~ 'foo'::text)
(2 rows)
# create extension pg_trgm;
# create index name_trgm_idx on some_table using gin (name gin_trgm_ops);
# explain select id, name from some_table where name ~ 'foo';
QUERY PLAN
-------------------------------------------------------------------------------
Bitmap Heap Scan on some_table (cost=14.62..842.99 rows=337 width=22)
Recheck Cond: ((name)::text ~ 'foo'::text)
-> Bitmap Index Scan on name_trgm_idx (cost=0.00..14.53 rows=337 width=0)
Index Cond: ((name)::text ~ 'foo'::text)
(4 rows)