B4J Question List with Types vs SQlite Memory

Discussion in 'B4J Questions' started by jmon, Jun 18, 2015.

  1. jmon

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

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

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

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

    LucaMs Expert Licensed User

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



    Join tables ;)
     
Loading...