Improve query speed for OCPP charge sessions by transaction ID

XMLWordPrintable

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major
    • Component/s: DB, OCPP
    • None

      There is a frequently used query on the solarev.ocpp_charge_sess table that follows this pattern:

      SELECT *
      FROM solarev.ocpp_charge_sess cs
      WHERE cs.ended IS NULL
      	AND cs.cp_id = $1
      	AND cs.tx_id = $2
      

      This results in a full table scan however, and the average query time is 18ms. An index on tx_id might be useful here to speed up the query.

            Assignee:
            Matt Magoffin
            Reporter:
            Matt Magoffin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: