B4J Question List with Types vs SQlite Memory

jmon

Well-Known Member
Licensed User
Hi,

I've done some tests and I found out that having a list with types in it is much faster than an SQLite :Memory: database.

Can any one confirm that? Is there a way to speed up memory databases to go as fast at the list with types?

Thanks.
 

LucaMs

Expert
Licensed User
It is very likely, given that the Lists are stored in RAM and DB data on "disk".
Try to save in someway the List and you will not get better times.

Also, with db tables/fields, you can filter/sort data.
 

jmon

Well-Known Member
Licensed User
Well for SQLite, I tried both ways, having the DB in memory completely, and also having a temp disk file, but both of them had a performance under the List with types. (I tried as mentioned here https://www.sqlite.org/inmemorydb.html).

Also, with db tables/fields, you can filter/sort data.
I found out that going through all the list and discarding unwanted results was still faster than using WHERE clauses in SQLite.

Also sorting the List with SortType isn't slow, and it can sort on multiple fields like Sqlite. (sorting once with a field, then a second time with another field).

The reason I want to go for SQlite is because it's possible to add columns at runtime. I need to add columns or type fields at runtime to be able to add more sort and grouping options, but I don't know what will be the user's sort and grouping requests.
 

LucaMs

Expert
Licensed User
I have
Well for SQLite, I tried both ways, having the DB in memory completely, and also having a temp disk file, but both of them had a performance under the List with types. (I tried as mentioned here https://www.sqlite.org/inmemorydb.html).
Do not forget that DB Tables have indexes (at leat ROWID) and insert data in an indexed table requires time. On the other hand, the search becomes faster.



I found out that going through all the list and discarding unwanted results was still faster than using WHERE clauses in SQLite.

Also sorting the List with SortType isn't slow, and it can sort on multiple fields like Sqlite. (sorting once with a field, then a second time with another field).
Join tables ;)
 
Top