Re: [SQL] select a part of a name

From: neko(at)kredit(dot)sth(dot)szif(dot)hu
To: pgsql-sql(at)hub(dot)org
Subject: Re: [SQL] select a part of a name
Date: 1999-12-09 02:36:39
Message-ID: Pine.LNX.4.10.9912090312510.23988-100000@kredit.sth.szif.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, 8 Dec 1999, Moray McConnachie wrote:
>
> > use: where name like '%names%'
>
> Except that the user specified he wanted to be able to find Tom Jones
> and jonas from the search text jon, so you either need to use:
>
> where lower(name) like ('%' ŚŚ lower(searchtext) ŚŚ '%')

> or something similar, which is slow unless you have an index on
> lower(name), and even then.
I think, this case always will be slow. Because the first '%'. I'm not
sure about all of access methods, and comparsion operators. But this
combination of them (btree/hash -- like) can't do indexed substr lookup.
Is there any tricks, to do it?

--
nek;(

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message marten 1999-12-09 08:08:24 Re: [SQL] subquery, except and view
Previous Message De Moudt Walter 1999-12-09 02:11:59 Re: [SQL] subquery, except and view