[V4WS] question on deleting records
Ruslan Zasukhin
sunshine at public.kherson.ua
Sat Mar 15 09:45:25 CST 2003
on 3/15/03 2:01 AM, Luca Porfiri at liste at mail.sting.it wrote:
> Hi Ruslan and everyone,
>
> I am searching for hints on deleting records from a very big BaseObject with
> a very big index.
> Let me describe how big:
>
> the db is
> .blb = 1,57 Gb
> .dat = 425 Mb
> .ind = 253 Mb
>
> the main BaseObject has 230.000 record and the amount of index depends on
> this BaseObject.
> Every day I update the db and index with 4Mb of data ca.
> The index is big enough to contain, at now, 98% of words contained in the
> new records I go to add to db and WS + Valentina update is very fast at
> least.
> I use this procedure:
>
> read all the file to import
> split it by record using \r to know number of records
> then i repeat for every record:
> make a cursor with all fields I will populate
> select with itemAt the record in the list of records I want to process
> split it in fields (using tab in the text of record as separator)
> then valSetBlankRecord
> then valAddRecord and valSetField fields with values of the fields in
> record to add
> finally valUpdateRecord
> and back again to the next record and so on ...
> It's fast enough to add and update also the indexes ... could we do better?
>
> NOW
>
> I need to delete old records but I fear it because delete records means
> update also indexes and this operation, I believe, is not so fast as adding
> records (but why?) I believe, instead, it could be very very slow ... or
> not?
> So could it be a way to do this fast?
Delete must be as fast as Add.
It is update() command take = time of delete + time of Add.
So it should be in average 2 times slower.
> Is better to select little cursors and deleteAll or delete record by record
> or other?
Well, DeleteAll should be faster in theory.
If you have so big db of important data, I hope you do backups.
So after backup you can try DeleteAll for single cursor.
You need this operation only once?
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list