bah.database

BlitzMax Modules Forums/Brucey's Modules/bah.database

Perhaps my testing has a lot to be desired... :-/


With support like this I'm happy to help iron out the bugs. :)

Sorry if I'm getting annoying, but I've been running some speed comparisons between bah.database and teamonkeys sqlite mod (with pyropixel's SQLiter).

When SELECTing 1650 rows with "SELECT * from person" I get the following results...

bah.database
------------------
Local query:TDatabaseQuery = db.executeQuery("SELECT * from person")
While query.nextRow()
Local record:TQueryRecord = query.rowRecord()
Local name$ = record.getFieldByName("lastname").value.getString()
Wend
~410 millisecs

Local query:TDatabaseQuery = db.executeQuery("SELECT * from person")
While query.nextRow()
Local name$ = Query.rowRecord().getFieldByName("lastname").value.getString()
Wend

~370 millisecs

Local query:TDatabaseQuery = db.executeQuery("SELECT * from person")
While query.nextRow()
Wend
~160 millisecs

This suggests creating the TRecord is taking a while, but obviously it's needed to retrieve the data.



pyropixel.sqliter
--------------------
db.Query("SELECT * FROM person")
     
	 While db.NextRecord()
        Local name$ = db.F("lastname")
    Wend
~38795 millisecs

Local prepQ:Int = db.PrepareQuery("SELECT * FROM person")
     
	 While db.StepQuery(prepQ) = SQLITE_ROW
        Local name$ = db.P(prepQ, "lastname")
    Wend
~30 millisecs

The prepared querys with SQliter are lightning fast and I really need that sort of speed as the game often needs to retrieve 100s of records. I tried the bah.database prepared queries but they don't make any difference to the retrieval speed. Is there anything I can do to speed up selection?

BTW Bah.Database is faster at INSERTs. :D