pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Vladimir Dobrokhotov <dvs@rybvod.kamchatka.su>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] binary search
Date: Tue, 15 Dec 1998 14:37:46 +0200
Message-ID: <l0311070cb29c03cd0938@[147.233.159.109]> (raw)
In-Reply-To: <01be2731$721f7ea0$261313d4@dvs.rybvod.kamchatka.su>

At 9:14 +0200 on 14/12/98, Vladimir Dobrokhotov wrote:


> I didn't find in documentation how to do binary search.
> I want to find records where (int2_field AND 8)=TRUE (8).
> Is this possible? Can I use index?

This is not binary search. Binary search is a search method in which you
eliminate half your search domain in each iteration.

If I am reading you right, you want to be able to perform bit-wise
operators. such as bitwise or (like in C: num1 | num2), bitwise and (num1 &
num2), bitwise not and shifts (num1 >> 3, num1 << 8).

I think such operators don't exist in the core PostgreSQL package, though
you may well design them yourself in C.

Herouth

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





view thread (2+ messages)

Message-ID: <l0311070cb29c03cd0938@[147.233.159.109]>
Permalink:  ../l0311070cb29c03cd0938@%5B147.233.159.109%5D/
Also on:    postgresql.org/message-id/l0311070cb29c03cd0938@[147.233.159.109]

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: herouth@oumail.openu.ac.il, dvs@rybvod.kamchatka.su
  Subject: Re: [SQL] binary search
  In-Reply-To: <l0311070cb29c03cd0938@[147.233.159.109]>
  References: <01be2731$721f7ea0$261313d4@dvs.rybvod.kamchatka.su> <l0311070cb29c03cd0938@[147.233.159.109]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox