Re: Slow tab completion w/ lots of tables

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Stephen Frost" <sfrost(at)snowman(dot)net>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Slow tab completion w/ lots of tables
Date: 2012-08-21 17:03:16
Message-ID: 503379040200002500049990@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2012-08-21 17:07:16 Re: PostgreSQL 9.2beta4 (& git HEAD) server crash on creating extension plpython3u
Previous Message Tom Lane 2012-08-21 17:01:09 Re: 9.2RC1 wraps this Thursday ...