B4J Question [jRDC2] with SQLite -> need help with WAL & Pool

Discussion in 'B4J Questions' started by jmon, Sep 20, 2016.

  1. jmon

    jmon Well-Known Member Licensed User

    Hello,

    I am using jRDC2 with SQLite.

    I have already set my SQLite db in PRAGMA journal_mode = wal:
    https://www.b4x.com/android/forum/t...ent-access-to-sqlite-databases.39904/#content

    but I read here:
    https://www.b4x.com/android/forum/t...ate-your-own-back-end-database.31616/#content
    that I should set the min & max pool size to 1:
    Code:
    Dim jo As JavaObject = pool
    jo.RunMethod(
    "setMaxPoolSize"Array(1))
    jo.RunMethod(
    "setMinPoolSize"Array(1))
    Is this correct? Because in my tests, that appeared to slow down the jRDC server.
    If I leave the default value of the pool, it returns results faster when I do multiple queries.

    Also, any other tweaks I could perform to improve the performance? For example, is there a way to cache queries?

    Thanks for your help
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Yes. There should only be a single connection at a time.

    The performance should be still quite fast: https://www.b4x.com/android/forum/threads/server-performance-measures.37502/#post-238853

    This is the responsibility of the SQL engine. You can extend jRDC and cache common query results. I recommend you to try first without it.

    The most important optimization is to use indices correctly.
     
    jmon likes this.
  3. jmon

    jmon Well-Known Member Licensed User

    Thank you, I will do that.

    I'm doing some performance tests, and I can insert 10K rows in 900ms with jRDC2, but on a local network.
    Querying a quite complex statement with multiple JOINs, I get the result in 500ms.
    Querying a simple statement, I get the result in 60ms.

    So that seems quite good.
     
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