Most Effective way to insert into an Indexed field

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Mon Nov 18 03:45:10 CST 2013


On 11/18/13, 8:21 AM, "Beatrix Willius" <bwillius at gmx.de> wrote:

> Working with Xojo I have this issue, too.
> 
> - Checking if the unique value is already in the database. The SQL query was
> slow. Going in Xojo through an exception was even slower. Now I have a
> VBitSet, which made my app on repeated data import quite a bit faster.

If you check a SINGLE recid, then better to use
        FindAsArraySet

Because for big tables, e.g. 1M records, BitSet will be 128Kb
but ArraySet only 4 bytes!
 

> - Adding record to a large table: I remember talking to Ruslan about this.
> This remains a problem.

In your case this was adding record with 3-5Kb text value,
Which is indexed by words, so we get few hundreds items add into index.

 
> For small to midsize databases it¹s faster to do a complete re-index after
> adding the records. But I think I had problems with this. Also when the
> re-index doesn¹t run in the background the customer isn¹t happy. For large
> databases when only a few records are added this doesn¹t work anyhow.

I do not think that we have indexing slower of other dbs. Right?
Usually Valentina is faster on index operations. And we have smaller
indexes.

So if speed is not enough, only way is "invent" new mechanisms:
    e.g. Add record into table  and
            put items to be indexed into some queue,
            in hope that vserver will produce them later on idle...

But idle can not happens ... And then we still must wait for index ...
Or .. Even better put that index tasks to other cores ...

Yes this is the best solution I think ...

First of all for vserver ...
For ADKs only when and if they become really MT.


-- 
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 Valentina mailing list