Fastest way to display SQLite data?

Discussion in 'Questions (Windows Mobile)' started by RB Smissaert, Dec 5, 2008.

  1. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Having a go with SQLite and started with the supplied sample application SQL.
    This displays the data like this:
    cmd.ExecuteTable("table1", 0)
    but I find it is quite slow. Not sure if the select query is slow or the moving of the data to the grid, but I suspect the last.
    What is the fastest way to do this?
    Are there other options then using the supplied dll from phxsoftware?

    RBS
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    How many records (rows * columns) do you want to show?
     
  3. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Yes, you probably hit the nail on the head there, I was showing a large amount of data, say 50.000 * 10. And I suppose there is little point in that. I was comparing getting this into Excel with showing that on the PPC and in Excel I can do that in some 10 secs, but on the PPC it will take some minutes.
    One thing I noticed with the supplied SQLite library is that you can't get the data straight from SQLite into a plain array and deal with the display of the data yourself. Am I overlooking something?

    RBS
     
  4. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    I forgot to say that if I run it with the Basic4ppc desktop app it runs very quick so the slowness has nil to do with the supplied SQLite library, but it must be the table control that is used here.

    RBS
     
  5. agraham

    agraham Expert Licensed User

    Don't forget that devices are very underpowered compared to desktops so don't expect too much performance from them.
     
  6. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Yes and I don't in fact need to show large amounts of data and was just doing some testing. So, all in all I don't think there is a problem. Will do some testing now with some taxing SQL, but small amount of records to see what happens there.

    RBS
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    The power of the SQL language is that it allows you to retrieve only the data you need.
    As you wrote, in most cases it is not pretty useful from a user perspective to have a list with 50,000 rows.
     
  8. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Sure, fully agree there.
    Is there a way though to get data from SQLite (ideally in a plain array) without outputting it to a control?

    RBS
     
  9. Erel

    Erel Administrator Staff Member Licensed User

  10. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Ah, yes, I see now. Reader is a kind of Recordset?

    RBS
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    Reader is a pointer (cursor) that points to a single row. The reader can advance forward and eventually read all results.
    ExecuteTable method uses a reader to go over all results and add it to a table.
     
  12. N1c0_ds

    N1c0_ds Active Member Licensed User

    I use LIMIT and OFFSET to show only, for example, records 101-110. This way it loads only the records to be displayed and hides the rest.

    I can't really provide an example yet, but it's incredibly fast.
     
Loading...
  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