Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> Would people accept adding an index on pg_class.relname to support
> fast tab-completion? Or is this going to expand into figuring out
> how to support index-based partial lookups for the 'name' type, so
> we could use the existing index (if that's even possible
> to do...)?
That already seems to work for me.
explain analyze
select relname from pg_class where relname like 'Party%';
Index Scan using pg_class_relname_nsp_index on pg_class
(cost=0.00..0.47 rows=1 width=64)
(actual time=0.027..0.060 rows=19 loops=1)
Index Cond: ((relname >= 'Party'::name)
AND (relname < 'Partz'::name))
Filter: (relname ~~ 'Party%'::text)
Total runtime: 0.084 ms
-Kevin