pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Efficient String searching
3+ messages / 3 participants
[nested] [flat]

* Efficient String searching
@ 2001-09-25 06:00  Robert.Farrugia@go.com.mt
  0 siblings, 1 reply; 3+ messages in thread

From: Robert.Farrugia@go.com.mt @ 2001-09-25 06:00 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I have the following problem.  When doing string searches using the ilike
command, no indexes are being used.  This is giving performance problems,
whereas it takes longer to sequentially search the whole table.  Am i
missing something about searching for strings ?  Are there any efficient
methods than using regular expressions or like ?

Thanks
Robert






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

* Re: Efficient String searching
@ 2001-09-25 17:42  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Robert.Farrugia@go.com.mt
  0 siblings, 1 reply; 3+ messages in thread

From: Stephan Szabo @ 2001-09-25 17:42 UTC (permalink / raw)
  To: Robert.Farrugia@go.com.mt; +Cc: pgsql-admin

On Tue, 25 Sep 2001 Robert.Farrugia@go.com.mt wrote:

> Hi,
> 
> I have the following problem.  When doing string searches using the ilike
> command, no indexes are being used.  This is giving performance problems,
> whereas it takes longer to sequentially search the whole table.  Am i
> missing something about searching for strings ?  Are there any efficient
> methods than using regular expressions or like ?

Unless your pattern is anchored at the start, indexes don't get used.  In
addition, if you're in a locale other than C, indexes don't get used.
It depends on the kind of string searches you're doing.  If you're looking
for words in a longer string, you probably want to look at a full text
indexing solution.  IIRC, there's one in contrib and a few others made by 
people on the lists.




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

* Re: Efficient String searching
@ 2001-09-25 18:23  Ted Rolle <ted@tvlconn.com>
  parent: Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Ted Rolle @ 2001-09-25 18:23 UTC (permalink / raw)
  To: 'Stephan Szabo' <sszabo@megazone23.bigpanda.com>; Robert.Farrugia@go.com.mt; +Cc: pgsql-admin

Like an implementation of Boyer-Moore-...?

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Stephan Szabo
Sent: September 25, 2001 10:43 AM
To: Robert.Farrugia@go.com.mt
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Efficient String searching


On Tue, 25 Sep 2001 Robert.Farrugia@go.com.mt wrote:

> Hi,
> 
> I have the following problem.  When doing string searches using the ilike
> command, no indexes are being used.  This is giving performance problems,
> whereas it takes longer to sequentially search the whole table.  Am i
> missing something about searching for strings ?  Are there any efficient
> methods than using regular expressions or like ?

Unless your pattern is anchored at the start, indexes don't get used.  In
addition, if you're in a locale other than C, indexes don't get used.
It depends on the kind of string searches you're doing.  If you're looking
for words in a longer string, you probably want to look at a full text
indexing solution.  IIRC, there's one in contrib and a few others made by 
people on the lists.


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster




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


end of thread, other threads:[~2001-09-25 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-09-25 06:00 Efficient String searching Robert.Farrugia@go.com.mt
2001-09-25 17:42 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-09-25 18:23   ` Ted Rolle <ted@tvlconn.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