Re: [SQL] Newbie questions

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Remigiusz Sokolowski <rems(at)gdansk(dot)sprint(dot)pl>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Newbie questions
Date: 1998-12-15 14:29:09
Message-ID: l03110710b29c1f4a7f9f@[147.233.159.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 15:41 +0200 on 15/12/98, Remigiusz Sokolowski wrote:

> So if they do match - I don't need to use with them some wild characters
> (* or %)? And second question: Can I use % with = operator?
> I know - simple question, but I feel now a little confused - manual
> doesn't clear it either - I thought about it, but as long as all works
> fine - I haven't needed this knowledge.

Make the distinction between a MATCH and an EQUALITY. A "match" is
comparing to a pattern, and there can be more than one text that makes the
comparison work. The '=' does not take wildcards - it is an equality test.
It tests *exactly*.

An equality test has an advantage in index usage. Case-insensitive matching
doesn't trigger indices in any case (as far as I know). Case-sensitive
matching triggers them only if the pattern is anchored to the left (That
is, in a LIKE comparison, the pattern doesn't start with % or _, and in
regular expression, it starts with a ^ followed by simple characters).

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message David Hartwig 1998-12-15 14:55:24 Re: [SQL] MINUS and slow 'not in'
Previous Message Remigiusz Sokolowski 1998-12-15 13:41:04 Re: [SQL] Newbie questions