Slow Database Deletes
- From: Peter <peter@xxxxxxxxxxxxxxxxxxxxxx*>
- Date: Thu, 15 Dec 2005 15:49:22 +1100
I have been experimenting for the first time with the built in database
in RB2005. While adding lots of records (1000) at once seems very quick,
deleting all records (6000) takes about 30 seconds on my iBook 700MHz
G3. Is this fairly normal for databases?
here is the code I am using:
rs = MusicLib.SQLSelect("SELECT rowid, * FROM SONG")
while not rs.eof
rs.DeleteRecord
rs.MoveNext
Wend
I tried moving to the end of the record set and deleting backwards but
that was worse and eventually hung:
rs.MoveLast
while not rs.eof
rs.DeleteRecord
rs.MovePrevious
Wend
Also I didnt call Commit after deleting yet the data was all gone. Does
this mean Undoing record deletion is not really possible?
Maybe it would be better 'flag' the records as deleted then slowly
delete them in a thread?
thanks!
Peter
www.fracturedSoftware.com
zegsRuler - Add Rulers to your RB project in minutes!
Rondo - Midi made easy.
.
- Follow-Ups:
- Re: Slow Database Deletes
- From: JM
- Re: Slow Database Deletes
- Prev by Date: Re: Hiding the Menu Bar in Mac OS X Tiger
- Next by Date: Re: Hiding the Menu Bar in Mac OS X Tiger
- Previous by thread: Icon in minimised application
- Next by thread: Re: Slow Database Deletes
- Index(es):
Relevant Pages
|