Re: [SQL] how to tell the difference between empty field and null field

Поиск
Список
Период
Сортировка
От Alex Howansky
Тема Re: [SQL] how to tell the difference between empty field and null field
Дата
Msg-id Pine.LNX.4.20.9912122315040.20864-100000@net-srv-0001.bvrd.com
обсуждение исходный текст
Ответ на Re: [SQL] how to tell the difference between empty field and null field  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [SQL] how to tell the difference between empty field and null field  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] how to tell the difference between empty field and null field
Следующее
От: Brent Wood
Дата:
Сообщение: Problem copying polygon data into a table