Re: bit operations

Поиск
Список
Период
Сортировка
От Oliver Vecernik
Тема Re: bit operations
Дата
Msg-id 3B4420F0.57080139@aon.at
обсуждение исходный текст
Ответ на bit operations  ("Johan Björk" <johan@websidorna.com>)
Ответы Re: bit operations  (merlyn@stonehenge.com (Randal L. Schwartz))
Список pgsql-general
"Randal L. Schwartz" wrote:
>
> >>>>> "Oliver" == Oliver Vecernik <vecernik@aon.at> writes:
>
> >> Say I wanna check if 8 (1xxx) and 2 (xx1x) is set, how do I do that?!
>
> Oliver> Sorry, I didn't read the whole question first:
>
> Oliver> select * from table where ((flags & 8) <> 0) and ((flags & 2) <> 0);
>
> In the old days, we spelled that as flags & 10 = 10. :)  Wouldn't that
> work just as well?

As far as I know testing for <> 0 could be calculated faster. Does
anybody know if this is true?

Regards,
Oliver

В списке pgsql-general по дате отправления:

Предыдущее
От: eddie iannuccelli
Дата:
Сообщение: Re: Re: 7.1.2 ERROR: UNIQUE constraint matching given keys for referenced table ......
Следующее
От: "Richard Huxton"
Дата:
Сообщение: Re: postgres and unix time format