pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Re: Very slow search using basic pattern matching
Date: Tue, 18 May 2004 19:15:04 +0200
Message-ID: <20040518191504.C607@hermes.hilbert.loc> (raw)
In-Reply-To: <A02B0582-A8E2-11D8-9565-000A958E367A@llgc.org.uk>
References: <A02B0582-A8E2-11D8-9565-000A958E367A@llgc.org.uk>

> WHERE  
> 	da_records.DESCRIPTION_CY ~* '.*Aberystwyth*.' 
>  OR  
> 	da_records.TITLE_CY ~* '.*Aberystwyth*.'  
> limit 100 
> 
> Is there a better way of matching the string? (Must be case 
> insensitive) 
Are you sure you can't anchor the search pattern ?

eg  ~* '^' || lower('Aberystwyth') || '.*'

That'd allow for use of (functional) indices.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



view thread (5+ messages)  latest in thread

Message-ID: <20040518191504.C607@hermes.hilbert.loc>
Permalink:  ../20040518191504.C607@hermes.hilbert.loc/
Also on:    postgresql.org/message-id/20040518191504.C607@hermes.hilbert.loc

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: Karsten.Hilbert@gmx.net
  Subject: Re: Very slow search using basic pattern matching
  In-Reply-To: <20040518191504.C607@hermes.hilbert.loc>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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