Database - quickest way to do this?

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Jun 10 10:22:16 EDT 2007


On 10/6/07 4:57 PM, "David Bovill" <david at openpartnership.net> wrote:

>>> So I guess I do an "or" SQL search for all these keywords, and then loop
>>> through them checking hits. Or do I do "AND" searches, and iterate
>> replacing
>>> the "AND" with "OR" to widen the search?
>> 
>> 1) Actually it is not clear:
>>     your result should contain OR or AND for words?
>> 
>>           word1 AND word2 ...
>> or
>>           word1 OR word2 ...
> 
> 
> Sorry - to be clear. Lets call it a find similar search.
> 
> I have a handler that is tagged "xml,html,array,add,combine,base64,david...
> etc" and I want to find siilar handlers ranked by priority, so handlers
> which contain all the keywords come first, the taglist above is ordered by
> importance so "xml" is more important than "html" - so I'm looking for a
> design pattern for the search - I guess this has been done so many times and
> its an art - so I'd like not to reinvent the wheel?

Well, Valentina do not have built-in such feature "ranked search by words".

Interesting take a look on other dbs as MS SQL, Oracle. If they have this,
then I think implement algorithm will be deal of 7-15 days for team.

And THIS way - will be the fastest I think :-)
Because engine will do task at C++ level.

>> 2) Do you think about LOCAL db, or you need access remote server ?
>>     it seems if you talk about lists or SqlLite, it is local
>>     right ?
> 
> Yes - but mirrored on the server. The server would have the same schema as
> the local db, users could search the online db

But around DB will be some middleware, e.g. On PHP or Revolution?
If yes, then for this middleware, DB still looks as local.

> for individual handlers, or download the whole library via svn or other
> methods and search fast locally within the ide.
> 
> 3) for now I can give this point:
>> Valentina API (and V4REV) also, has LOW LEVEL API calls.
>> 
>>   * Update S(r) in the list of Widow asynchronous.
>> ---------------------------------------------------
>> 
>> Above this is the only algorithm to split the whole task into few steps on
>> low level and get asynchronous execution as you did want.
> 
> 
> Sounds good - but how does the asynchronous execution work - does the
> external issue callbacks you can trap in Rev?

No callbacks.

Just you have at least 3 independent tasks:

    a) search of the next SET for WordN
    b) algorithm that ACCUMULATE Last search into RESULT
    c) display of LAST result to user.

So it is possible do these tasks more or less in parallel way, using 3
threads. I.e. Your code provides asynchronous.
 
But may be for 10K records in T1 linked to 50-100K records in T2,
It is not so big time, if engine self will do such command.
As I understand you expect to have about 0.1-0.3 second to be fast for user.

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]





More information about the use-livecode mailing list