Android Question Large Database

Discussion in 'Android Questions' started by Enthousiastic, Jun 15, 2015.

  1. Enthousiastic

    Enthousiastic Active Member Licensed User

    Hello , i have a database .db format made by sqlite having 11.000 records . I use Table class module , to display it and all are OK .
    The problem is that is slow in loading even in an 8core Samsung tablet.
    Any idea if there is a method made it faster ? Th database is 8MB and i cannot send you because of size limitation.

    Many thanks Enthousiastic
  2. DonManfred

    DonManfred Expert Licensed User

    You should consider to display only X datasets ()50, 100) and reload more if needed...
    KMatle and Mahares like this.
  3. Mahares

    Mahares Well Known Member Licensed User

    If Erel sees this thread he will advise you that it is not at all practical to try to display 11000 records at once.
    1. Break up the data by using WHERE clauses to display only pertinent data.
    2. In your SQL statement, request only the needed columns. Do not use all of them.
    3. Indexing table by some columns will help, although many indexed fields can slow it down.
    4. As a last resort use: SQL1.ExecQueryAsync(.......
    mangojack and DonManfred like this.
  4. Troberg

    Troberg Well-Known Member Licensed User

    Well sometimes you have to display lots of data at once. Sometimes, it's possible to do a "load on demand" to speed things up, sometimes (such as displaying data in maps), you just have to read it all in one chunk.

    That said, all the normal database optimizations should work.

    I wouldn't say that 11000 records is a large database, though. I have databases with 20 million records (although, not on a mobile device), and even those are not considered large by database standards. This makes me suspect that the performance problem is not in the database, but in the display. Try timing just the database operations, to see if the problem is really there.
  5. Peter Simpson

    Peter Simpson Expert Licensed User

    I had the exact same problem with the Table Class @Enthousiastic, what I did to speed up the population of tables apart from using Limit in the query was the following.

    Move the following lines directly into the Table Class, this does speed up the population by quiet a lot. Just experimenting by moving table settings lines directly into the Table Class, I found that helped a lot.
    'Move these lines
        Table1.HeaderColor = Colors.Blue
        Table1.HeaderTextColor = 
        Table1.TextColor = 
        Table1.TableColor = 
        Table1.RowHeight = 
        Table1.RowColor1 = 
        Table1.RowColor2 = 
        Table1.AllowSelection = 
    I may also have moved the following into the table class as well.
    Table1.MultiSelect = False
        Table1.SortColumn = 
        Table1.SingleLine = 
    Admittedly I've turned the Table Class into a library as I personally prefer to use it that way.

  6. keirS

    keirS Well-Known Member Licensed User

  7. Enthousiastic

    Enthousiastic Active Member Licensed User

  8. Enthousiastic

    Enthousiastic Active Member Licensed User

    Sorry i don't understand the module i use is the following .bas .Where can i put the above lines ?

    Attached Files:

  9. Peter Simpson

    Peter Simpson Expert Licensed User

    You take those lines out of the module that your table is in, and put them in the Table Class...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice