Slow Database Deletes




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.
.