Re: [SQL] how to tell the difference between empty field and null field - Mailing list pgsql-sql

From Alex Howansky
Subject Re: [SQL] how to tell the difference between empty field and null field
Date
Msg-id Pine.LNX.4.20.9912122315040.20864-100000@net-srv-0001.bvrd.com
Whole thread Raw
In response to Re: [SQL] how to tell the difference between empty field and null field  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [SQL] how to tell the difference between empty field and null field
List pgsql-sql
> An index on (user, domain) is perfectly useless for the above query,
> because the user field isn't mentioned anywhere in the query.  An index
> on domain alone could be used, though, and should be pretty effective.
> (We do have some performance problems if you get into dozens of OR
> terms, but for just a couple, no sweat.)

Heh heh, oops. Index on domain alone is what I meant, sorry, I was trying to
mix two different examples in my head without actually running them. :)

My main concern is with the use of the 'or' in the query. My experience is
mostly with Progress -- it (at least the ancient version that I'm used to)
can't utilize the index on a field _at all_ if your query uses an 'or' on that
field. As a result, I've become extremely cautious about doing this with
Postgres. You seem to be saying that it's no a big deal -- that the index will
still be utilized and that performance will not suffer significantly. Is this
something that I can finally forget worrying about?

Thanks for the help and the speedy reply.

-- 
Alex Howansky
alex@wankwood.com
http://www.wankwood.com/




pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] how to tell the difference between empty field and null field
Next
From: Brent Wood
Date:
Subject: Problem copying polygon data into a table