~* OR LIKE?

From: "Matt Friedman" <matt(at)daart(dot)ca>
To: "PgSql General List" <pgsql-general(at)postgresql(dot)org>
Subject: ~* OR LIKE?
Date: 2001-03-23 22:18:48
Message-ID: 00bc01c0b3e7$3bcf6a00$03284d18@mattq3h8budilr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a query that I could run a number of ways:
Like this:

index_word.word ~*'radio.*'
OR
index_word.word ~*'spry.*'

Or I could use LIKE and the "%" comparison

If I toss out the need for comparisions I could just use: IN
('radio','spry')

What's the relative performance for: "IN" "LIKE" or "~*"? I'm trying to
decide if the performance loss of doing extra string compares is worth
getting slighly more relevant results.

Matt Friedman

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2001-03-23 22:19:18 Re: Re: Re: Rules, views, sequences and returned values
Previous Message Matt Friedman 2001-03-23 22:13:55 Vacuum VS Vacuum Analyze