Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-20658

[Performance] QSqlQuery::boundValues has unneeded O(n^2) complexity, can be O(n)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.0.0 Beta 1, 5.0.0
    • 4.7.3
    • SQL Support
    • None

    Description

      For each bound value a call is made to QSqlResult::private->indexes.index(QHash.index, which is O(n)), which results in overall complexity of O(n^2).

      For ORMs that select records by a list of primary or foreign keys this can end up taking much longer than needed.

      Attached patch makes the call O(n).

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-20658
          # Subject Branch Project Status CR V

          Activity

            People

              zhongle honglei zhang
              newellm Matthew Newell
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes