pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Patrik Kudo <kudo@partitur.se>
To: pgsql-sql@postgresql.org
Subject: indexing and LIKE
Date: Thu, 11 Oct 2001 14:28:34 +0200 (CEST)
Message-ID: <20011011141651.B50778-100000@tb303.partitur.se> (raw)

Hi!

If I want to be able to search for stringmatches using LIKE, doing
something like the following:

select id, name from table1 where lower(name) like 'somestring%';

Actually I will be joining with some other table on id too, but the join
will produce a substancial amount of data to be filtered with the LIKE
clause so I figure if it'd be possible to index on lower(name) somehow,
it would result in an appreciated speed gain.

Is it at all possible to create an index on lower(name), and in that case,
what type of index and using what syntax? Is it possible to create a
multicolumn index on both id and name? Both id and name are of type
"text".

TIA,
Patrik Kudo




view thread (7+ messages)  latest in thread

Message-ID: <20011011141651.B50778-100000@tb303.partitur.se>
Permalink:  ../20011011141651.B50778-100000@tb303.partitur.se/
Also on:    postgresql.org/message-id/20011011141651.B50778-100000@tb303.partitur.se

 · 

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: kudo@partitur.se
  Subject: Re: indexing and LIKE
  In-Reply-To: <20011011141651.B50778-100000@tb303.partitur.se>

* 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