Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-998

Question regarding useServerPrepStmts documentation

    XMLWordPrintable

    Details

      Description

      Hello

      I'm migrating from mysql connector J to mariadb connector J.
      I have some legacy projects using server side prepared statements.
      I have read Marias' connector source code both 2.x and 3.x.
      Maria's connector documentation states the following about useServerPrepStmts

      The applications that repeatedly use the same queries have value to activate this option, but the general case is to use the direct command (text protocol)
      

      My question is : why is the general case documented as set to use the direct command ?

      AFAIU binary protocol is better because it has less overhead and execution benefits from a cached execution plan. There is also a safe upper limit of 8192 bytes (on the connector side when clientPrepStmts are used) so cached ones do not add much memory usage.

      Of course preparing triggers a prepare & execute instead of a raw query. I'm not sure it may alter performances.

      Or is the text protocol just "safer" or "better" ? Is it to avoid cache misshits ?

      Thanks

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            lperez laurent perez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.