Re: [SQL] select a part of a name - Mailing list pgsql-sql

From neko@kredit.sth.szif.hu
Subject Re: [SQL] select a part of a name
Date
Msg-id Pine.LNX.4.10.9912090312510.23988-100000@kredit.sth.szif.hu
Whole thread Raw
In response to Re: [SQL] select a part of a name  ("Moray McConnachie" <moray.mcconnachie@computing-services.oxford.ac.uk>)
Responses Re: [SQL] select a part of a name
List 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;(



pgsql-sql by date:

Previous
From: De Moudt Walter
Date:
Subject: Re: [SQL] subquery, except and view
Next
From: "tjk@tksoft.com"
Date:
Subject: Re: [SQL] select a part of a name