Repeated copying of the result row in DAOs

Bug #1201991 reported by RJ Skerry-Ryan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Medium
Nazar Gerasymchuk

Bug Description

After exec()'ing a QSqlQuery, we often call QSqlQuery::record() to get a QSqlRecord in order to look up column indexes by name. Every time you call QSqlQuery::record() after the query has been executed, it copies all the data for the row into the record.

This means in a case like TrackDAO::getTrackFromDB, we call record() 25 times! Once for every column we look up.

The solution is to only call QSqlRecord once per prepared query and before exec()'ing it to avoid copying any data.

RJ Skerry-Ryan (rryan)
tags: added: dao library performance
Changed in mixxx:
status: New → Confirmed
importance: Undecided → Medium
RJ Skerry-Ryan (rryan)
Changed in mixxx:
assignee: nobody → Nazar Gerasymchuk (troyan3)
milestone: none → 1.12.0
status: Confirmed → Fix Committed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/7106

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.