Genetic string searches Re: VChar vs VText
Ed Kleban
Ed at Kleban.com
Wed Nov 30 08:57:19 CST 2005
On 11/28/05 7:06 AM, "Ruslan Zasukhin" <sunshine at public.kherson.ua> wrote:
> On 11/28/05 5:08 AM, "Ed Kleban" <Ed at Kleban.com> wrote:
>
>>>> Either way, I'm sure glad I'm doing my searches on string hashes rather
>>>> than
>>>> actual strings.
>>>
>>> Hashing can work only for search fld = "xxx"
>>>
>>> But you cannot do range searches using hashing, right ?
>>
>> Correct. But now I'd like elaborate on an earlier note I made about a
>> feature I'd like to see:
>>
>> The functions would simply perform a BitAnd between the field value and
>> inMask. If the result was equal to inMask it would qualify as an exact
>> match. If the result was non-zero it would qualify as a partial match.
>
> Well, I believe you can get this right now, Ed in 2 ways:
>
> 1) using SQL and methods
> 2) using calculated fields and methods.
>
> Valentina support a lots of functions. And I believe it support bit And.
>
> So you can do something as:
>
> SELECT .. FROM T WHERE fld & mask
>
> Or you can make Table Mathod -- calcualted field:
>
> fldM = t.CreateBooleanField( "name", "fld & mask" )
>
> You can even index it.
> And you can change formula on the fly.
> And you can have many calculated fields for table...
>
> Check docs on this feature
>
Well, I'd be thrilled if this were true, but I can't find any info about
this anywhere in the Kernel, V4RB Reference, or SQL_2 manuals.
Several times in the past I've searched for "bit", which turns up nothing in
these documents except "bitset" of course. Searching for "xor" does indeed
take me to the "Logical Operators" section of the SQL manual on page
VSQL-76, however the Not, And, Xor, and OR operators defined there are all
defined in terms of strictly boolean values defined as 0 = false or non-zero
= true. I.e. the description for "OR" is: " Returns 1 if any operand is
non-zero, otherwise returns 0. " This implies to me that these are not
bitwise functions, but treat an entire ULong as a single binary value with
31 wasted bits.
I hadn't thought to search for "&", but all that does is lead me to the "&&"
operator which is an abbreviation for Logical "AND" defined as: " Returns 1
if all operands are non-zero, otherwise returns 0. "
Actually, I'm unable to find nuch info at all in the manuals about
calculated fields. There are a dozen references or so desrcibing how
certain things work or not in the case of a calculated field, but nowhere
have I found a description of usage, available operators, and limitations
for making these work. Is there perhaps some other SQL reference work you
could refer me to that does?
As far as boolean fields go, this is not really a solution. I'm not looking
for a way to create 16 separate single-bit boolean fields that I write
complex separate logic for in RB methods that operate on returned values or
with calculated field methods with long involved code. I'm looking for a
fast bitwise operation that can perform 32 parallel bit comparisons with a
single "&" operator and move on to check the next record.
That make sense? Or am I really missing something here?
More information about the Valentina
mailing list