pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Search string without tsearch
4+ messages / 4 participants
[nested] [flat]

* Search string without tsearch
@ 2008-01-28 17:38  A.Burbello <burbello3000@yahoo.com.br>
  0 siblings, 3 replies; 4+ messages in thread

From: A.Burbello @ 2008-01-28 17:38 UTC (permalink / raw)
  To: pgsql-admin

Hi people,

I would like to some suggestion to search person name
in a table that has more than 150 milions of rows ...

e.g ... name like 'JOHN%SMITH';

I know there is contrib Tsearch, but I can't for
political reasons.
Is there any way to do with good performance???

Thank you.


      Abra sua conta no Yahoo! Mail, o único sem limite de espaço para armazenamento!
http://br.mail.yahoo.com/



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Search string without tsearch
@ 2008-01-28 18:41  Scott Marlowe <scott.marlowe@gmail.com>
  parent: A.Burbello <burbello3000@yahoo.com.br>
  2 siblings, 0 replies; 4+ messages in thread

From: Scott Marlowe @ 2008-01-28 18:41 UTC (permalink / raw)
  To: A.Burbello <burbello3000@yahoo.com.br>; +Cc: pgsql-admin

On Jan 28, 2008 11:38 AM, A.Burbello <burbello3000@yahoo.com.br> wrote:
> Hi people,
>
> I would like to some suggestion to search person name
> in a table that has more than 150 milions of rows ...
>
> e.g ... name like 'JOHN%SMITH';
>
> I know there is contrib Tsearch, but I can't for
> political reasons.
> Is there any way to do with good performance???

Would pointing out to the PHBs that tsearch was integrated into pgsql
with v8.3 help convince them to stop being reactionary idiots?



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Search string without tsearch
@ 2008-01-29 17:43  Andrew Sullivan <ajs@crankycanuck.ca>
  parent: A.Burbello <burbello3000@yahoo.com.br>
  2 siblings, 0 replies; 4+ messages in thread

From: Andrew Sullivan @ 2008-01-29 17:43 UTC (permalink / raw)
  To: pgsql-admin

On Mon, Jan 28, 2008 at 02:38:15PM -0300, A.Burbello wrote:
> e.g ... name like 'JOHN%SMITH';
> 
> I know there is contrib Tsearch, but I can't for
> political reasons.
> Is there any way to do with good performance???

No.  Also, rejecting the provided feature in the system for political
reasons is a poor technical choice.  I sympathise, but whoever the
politician is needs to get a clue, or you'll never be able to make the
system operate as it should.

A




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Search string without tsearch
@ 2008-01-30 04:34  Markus Bertheau <mbertheau.pg@googlemail.com>
  parent: A.Burbello <burbello3000@yahoo.com.br>
  2 siblings, 0 replies; 4+ messages in thread

From: Markus Bertheau @ 2008-01-30 04:34 UTC (permalink / raw)
  To: A.Burbello <burbello3000@yahoo.com.br>; +Cc: pgsql-admin

2008/1/28, A.Burbello <burbello3000@yahoo.com.br>:
> Hi people,
>
> I would like to some suggestion to search person name
> in a table that has more than 150 milions of rows ...
>
> e.g ... name like 'JOHN%SMITH';
>
> I know there is contrib Tsearch, but I can't for
> political reasons.
> Is there any way to do with good performance???

For LIKE 'John%Smith' you can create one index on the column and one
on reverse(column), and use LIKE 'John%' AND LIKE reverse('%Smith').
The first condition should use the forward index, the second one the
reverse index.

The reverse function needs to be implemented in C for speed, I'm sure
someone else on the list can help out with that.

Markus



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2008-01-30 04:34 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-01-28 17:38 Search string without tsearch A.Burbello <burbello3000@yahoo.com.br>
2008-01-28 18:41 ` Scott Marlowe <scott.marlowe@gmail.com>
2008-01-29 17:43 ` Andrew Sullivan <ajs@crankycanuck.ca>
2008-01-30 04:34 ` Markus Bertheau <mbertheau.pg@googlemail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox