Re: So do we really *need* those substring() ops in tab-completion queries?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: So do we really *need* those substring() ops in tab-completion queries?
Date: 2010-01-03 10:48:56
Message-ID: 20100103104855.GA11071@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 02, 2010 at 08:21:35PM -0500, Tom Lane wrote:
> 3. Inefficient. It seems likely to me that filtering on the prefix on
> the backend side isn't going to be more efficient than doing it on the
> client side, except maybe in the schema-name cases. If the conditions
> were phrased in a way that made them indexable, they might be worth the
> trouble --- but they aren't. In the worst case where we're asked for
> completions from a zero-length string, the backend-side substring ops
> are certainly pure overhead.

I would have thought cases where you have a million
tables/roles/users/triggers that it would be more efficient to avoid
transferring all those names over the wire if you're going to filter
99% anyway.

This does require the test on the server side to be such that it never
filters too many rows, so it does have to work. But there is merit to
doing some simple filtering if it works.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2010-01-03 10:55:31 Re: Cancelling idle in transaction state
Previous Message Jaime Casanova 2010-01-03 07:00:57 Re: about some parameters