Re: Slow tab completion w/ lots of tables

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Slow tab completion w/ lots of tables
Date: 2012-08-21 18:23:52
Message-ID: 20120821182352.GM1267@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom,

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> Um, I don't believe we do any case-insensitive search now, do we?

No, I don't suppose we do.. I was thinking we ran quote_ident() on the
search-string side, but apparently we don't, meaning:

select * from TE<tab>

doesn't find 'test'. I suppose it's alright to keep it that way.

> > We'd essentially do: LIKE 'xx%', and then run quote_ident() on the
> > result (I assume we can replace the whole word, right?). I'd also
> > strip off any ", for the purposes of searching with tab-completion.
>
> I think you might be saying the same thing I said in my prior message,
> but not quite sure.

You added the distinction that we have to watch out for embedded quotes.
Otherwise, I believe we had the same approach, which is to strip off a
leading quote, if there is one, and then compare the raw string directly
to relname using: LIKE 'xxx%'; If there is an embedded quote, go back
to using quote_ident and matching the whole string.

Thanks,

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2012-08-21 18:58:30 Re: sha1, sha2 functions into core?
Previous Message Tom Lane 2012-08-21 18:21:09 Re: Slow tab completion w/ lots of tables