Skip site navigation (1) Skip section navigation (2)

Re: LIKE optimization

From: Nabil Sayegh <nsmail(at)sayegh(dot)de>
To: rob <rob(at)cabrion(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: LIKE optimization
Date: 2001-01-17 10:48:10
Message-ID: 3A65786A.F1608513@sayegh.de (view raw or flat)
Thread:
Lists: pgsql-novice
rob wrote:
> 
> your using    table.attrib like '%'    to match everything except nulls
> right?
> 
> use table.attribute IS NOT NULL instead.

No, it's the web interface to our hotel-db. People can search for eg.
City but may leave this field blank.
So % is always appended (sometimes also prepended).

I didn't know that it doesn't match NULL, but fortunately the attributes
are all NOT NULL.

thx
cu

-- 
 Nabil Sayegh
 GPG-Key available at http://www.sayegh.de 
 (see http://www.gnupg.org for details)

In response to

Responses

pgsql-novice by date

Next:From: Orlando Eloy GentilDate: 2001-01-17 11:04:11
Subject: Problems with authentication
Previous:From: Tom LaneDate: 2001-01-17 04:56:39
Subject: Re: log file?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group