main logo
Subject: Re: Some "theoretical" help with data speed access?
Author: Ruslan Zasukhin
Posted: 2001/02/27 18:56:46
 
View Entire Thread
New Search


on 28/2/01 00:19, David Bovill at david /at/ openscript .D.O.T org wrote:

> I am trying to figure out if I can do a very simple "cheat" in terms of
> speeding up the search of the "tree" structure, and for this I need to know
> a bit more info on how data is searched with various functions, and which
> techniques are fastest...

first of all in db main speed up you get when a field is INDEXED.

> I have scripted an input field so that every time you finish typing a word
> it could do the next part of the recursive word search (by trapping the
> keydown message for the space bar). Each word search needs to be as fast as
> possible or it will make it difficult to type!

> Naturally database/Valentina solutions have already "cracked" this.... -:)

Andy, has such feature in his applications.
so yes this is possible :-)

aha, second important speed up -- size of cache, the more the better.

> If I have a very large text/data file, and I am searching this tree
> recursively - I know that the next word in the tree will be pretty close to
> the previous word I searched. The last thing I want to do is search the
> entire structure from the beginning each time (at present as I am using
> arrays to hold every entry I assume this is probably what I am doing).

BTW, know I can say you exactly:
recursive search require a lots of loops in used API.

so of course FASTET will be C++ solution, then REALbasic and Java.
VXCMD is about 5-15 times slower of REALbasic.

in DBMS you can not say how close one word is to other.
you can't control this on default.

Now, to be as fast as possible you should use UNQIUE Valentina feature:
RecID and ObjectPtr fields.

they work about 4 times faster of standard RDBMS way.


> So what are the fastest techniques to search from a particular point? In
> MetaTalk I can use offset, or seek (for a file on the hard disk) from a
> given character number, or I can simply delete the first lines of the data
> each time I search for a word.

Actually for all this ANSWER DBMS itself.

and if you do searches

lo
lon
long
longw
longwo
longwor
longword

then Valentina will use index, and YES inside of index all this words
located very closely, so after first search pages of index will be in RAM
and second search must be very fast.


> How would this be done in a database/Valentina? What techniques would be
> fastest and avoid searching from the beginning? Do I need to add id pointers
> from each record to the domain (ie the set of next records that can be
> mapped onto from the current node in the tree?)

> I have pretty limited database experience and know only a little about the
> relational/object models etc - so I base everything pretty well on what I
> would do to create a database in an xCard implementation -:(

in RDBMS you will not build own tree as you describe.
Tree is build inside of INDEX. and then is used binary search.

But MAY BE really there is sense for you to build tree using 1 or 2 or 3
tables to make this task even faster.

I don't know your task, so I wonder if you really need SO GREAT speed to
spend so many time and efforts on building of trees... May be you can just
store words in table and allow Valentina do rest dirty work for you.

> How would this be done in a database/Valentina? What techniques would be
> fastest and avoid searching from the beginning? Do I need to add id pointers

from beginning of what? of word?

Don't you think that set up of all this trees and additional info to
maintain this trees (pointers at least) eat all your win ?


-----------
David, please subscribe to Valentina list.
read all docs, try V4RB examples, and study Plant example of VSDK listed in
VDSDKrefences.pdf also

after you get this info it will be easier discuss your task and possible
solutions.


--
Best regards,
Ruslan Zasukhin

-------------------------
Paradigma.

e-mail: ruslan@paradigmasoft.com
web : http://www.paradigmasoft.com

To subscribe to the Valentina mail list
send a letter to valentina-on /at/ lists .D.O.T macserve.net
 
©2001 Ruslan Zasukhin
<-- Prior Message New Search Next Message -->