pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedbinary search
2+ messages / 2 participants
[nested] [flat]
* binary search
@ 1998-12-14 07:14 Vladimir Dobrokhotov <dvs@rybvod.kamchatka.su>
1998-12-15 12:37 ` Re: [SQL] binary search Herouth Maoz <herouth@oumail.openu.ac.il>
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Dobrokhotov @ 1998-12-14 07:14 UTC (permalink / raw)
To: pgsql-sql
Hello,
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?
Thank a lot.
Vladimir Dobrokhotov
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [SQL] binary search
1998-12-14 07:14 binary search Vladimir Dobrokhotov <dvs@rybvod.kamchatka.su>
@ 1998-12-15 12:37 ` Herouth Maoz <herouth@oumail.openu.ac.il>
0 siblings, 0 replies; 2+ messages in thread
From: Herouth Maoz @ 1998-12-15 12:37 UTC (permalink / raw)
To: Vladimir Dobrokhotov <dvs@rybvod.kamchatka.su>; pgsql-sql
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1998-12-15 12:37 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-12-14 07:14 binary search Vladimir Dobrokhotov <dvs@rybvod.kamchatka.su>
1998-12-15 12:37 ` Herouth Maoz <herouth@oumail.openu.ac.il>
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