psql wishlist: value completion

Started by David Garamondover 21 years ago5 messagesgeneral
Jump to latest
#1David Garamond
lists@zara.6.isreserved.com

Wouldn't it be cool if someday psql could do value completion?

# delete from person where lastname = 'Garam<tab>
# delete from person where lastname = 'Garamond' _

# delete from person where firstname = 'Da<tab><tab>
# delete from person where firstname = 'Da
Damian Darren Dave David Dawson

# delete from person where firstname = 'D<tab><tab>
Display all 215 possibilities? (y or n)

--
dave

#2Steve Crawford
scrawford@pinpointresearch.com
In reply to: David Garamond (#1)
Re: psql wishlist: value completion

On Friday 13 August 2004 12:18 pm, David Garamond wrote:

Wouldn't it be cool if someday psql could do value completion?

# delete from person where lastname = 'Garam<tab>
# delete from person where lastname = 'Garamond' _

# delete from person where firstname = 'Da<tab><tab>
# delete from person where firstname = 'Da
Damian Darren Dave David Dawson

# delete from person where firstname = 'D<tab><tab>
Display all 215 possibilities? (y or n)

Sure it would be cool - but as far as I can tell totally impractical.

Determining all the possible expandable values for a particular column
could very well require a full-table-scan of a multi-million row
table each time you try to tab-expand. Not only would performance be
terrible but get a few users doing this and you could really hammer
the server.

Cheers,
Steve

#3j0rd1 adame
jordi@jordi.net
In reply to: Steve Crawford (#2)
Re: [ok] Re: psql wishlist: value completion

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

El Vie 13 Ago 2004 16:27, Steve Crawford escribió:

On Friday 13 August 2004 12:18 pm, David Garamond wrote:

Wouldn't it be cool if someday psql could do value completion?

# delete from person where lastname = 'Garam<tab>
# delete from person where lastname = 'Garamond' _

# delete from person where firstname = 'Da<tab><tab>
# delete from person where firstname = 'Da
Damian Darren Dave David Dawson

# delete from person where firstname = 'D<tab><tab>
Display all 215 possibilities? (y or n)

Sure it would be cool - but as far as I can tell totally impractical.

Determining all the possible expandable values for a particular column
could very well require a full-table-scan of a multi-million row
table each time you try to tab-expand. Not only would performance be
terrible but get a few users doing this and you could really hammer
the server.

This could be an extra cool-hack and not nesesarely be part of the core
distribution.

greets

j0rd1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBHUbuB5QJme5SU08RAhp4AJ433eG+glvfarErjdsWLXGZd1joxACdGPhr
l1TsTGx7ARJNCNen7sObTo4=
=rpFy
-----END PGP SIGNATURE-----

#4Gaetano Mendola
mendola@bigfoot.com
In reply to: Steve Crawford (#2)
Re: psql wishlist: value completion

Steve Crawford wrote:

On Friday 13 August 2004 12:18 pm, David Garamond wrote:

Wouldn't it be cool if someday psql could do value completion?

# delete from person where lastname = 'Garam<tab>
# delete from person where lastname = 'Garamond' _

# delete from person where firstname = 'Da<tab><tab>
# delete from person where firstname = 'Da
Damian Darren Dave David Dawson

# delete from person where firstname = 'D<tab><tab>
Display all 215 possibilities? (y or n)

Sure it would be cool - but as far as I can tell totally impractical.

Determining all the possible expandable values for a particular column
could very well require a full-table-scan of a multi-million row
table each time you try to tab-expand. Not only would performance be
terrible but get a few users doing this and you could really hammer
the server.

Why you need a full-table-scan ? The search will be an anchored search and
with the right operator class a index scan can occur.
However I have do admit that is nice but impratical.

Regards
Gaetano Mendola

#5David Garamond
lists@zara.6.isreserved.com
In reply to: David Garamond (#1)
Re: psql wishlist: value completion

Steve Crawford wrote:

# delete from person where firstname = 'D<tab><tab>
Display all 215 possibilities? (y or n)

Sure it would be cool - but as far as I can tell totally impractical.

Determining all the possible expandable values for a particular column
could very well require a full-table-scan of a multi-million row
table each time you try to tab-expand.

Well, psql could display "Warning: this would require a full-table-scan
of a multi-million row table..." or "Warning: there are more than 100
possibilities, continue?" if there are no indexes or the first SELECT
... LIMIT 101 returns 101 rows.

--
dave