Re: Slow tab completion w/ lots of tables

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
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 17:20:24
Message-ID: 20120821172024.GJ1267@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Kevin Grittner (Kevin(dot)Grittner(at)wicourts(dot)gov) wrote:
> That already seems to work for me.

Ah, yes, that does.. I was using the query from tab-complete.c, which
wraps it in quote_ident(c.relanme), which ends up preventing us from
using the index.

There's a couple of other interesting corner cases, such as:

select * from "spa<tab>

Will return nothing, but:

select * from spa<tab>

Works just fine.

Similar, if you have a table called "TEST", then:

select * from "TE

works, but:

select * from TE
(or any other combo w/o a quote)

doesn't work.

Clearly, I'd be happier if we could use the index. To be honest, I
think it'd also be nice if we could auto-quote tables (I've got quite a
few people who do things like create tables through ODBC, or migrate
from another DB where everything is all-uppercase, or mixed-case, and it
sure would be nice if those "just worked"). I'm not sure that there's
much use-case for asking people to prefix their table with a "- seems
more like a surprise that it's required than expected.

That said, I'm sure there are points to be made about how there'd be
problems with not requiring the ", or with things more complex than just
mixed-case situations. Perhaps we need to go through and try to
enumerate what we want to happen in each situation and try to reach a
concensus (and a plan for how to implement it..).

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2012-08-21 17:36:10 Re: Slow tab completion w/ lots of tables
Previous Message Tom Lane 2012-08-21 17:11:11 Re: Slow tab completion w/ lots of tables