VirtualBox

Ignore:
Timestamp:
Jun 5, 2016 4:06:40 AM (9 years ago)
Author:
vboxsync
Message:

testresults.py: apparently left outer joins are more pleasing to the postgresql setup on tindertux. doesn't matter for unique foreign columns.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/core/testresults.py

    r61469 r61470  
    973973                  '          LIMIT %s OFFSET %s\n' % (cMaxRows, iStart,);
    974974
     975        # Note! INNER JOIN TestBoxesWithStrings performs miserable compared to LEFT OUTER JOIN. Doesn't matter for the result
     976        #       because TestSets.idGenTestBox is a foreign key and unique in TestBoxes.  So, let's do what ever is faster.
    975977        sQuery += '       ) AS TestSets\n' \
    976                   '            INNER JOIN TestBoxesWithStrings\n' \
     978                  '       LEFT OUTER JOIN TestBoxesWithStrings\n' \
    977979                  '                    ON TestSets.idGenTestBox     = TestBoxesWithStrings.idGenTestBox' \
    978980                  '       LEFT OUTER JOIN Builds AS TestSuiteBits\n' \
     
    11801182        found in all test results.
    11811183        """
    1182 
     1184        # Note! INNER JOIN TestBoxesWithStrings performs miserable compared to LEFT OUTER JOIN. Doesn't matter for the result
     1185        #       because TestSets.idGenTestBox is a foreign key and unique in TestBoxes.  So, let's do what ever is faster.
    11831186        self._oDb.execute('SELECT TestBoxesWithStrings.*\n'
    11841187                          'FROM   ( SELECT idTestBox         AS idTestBox,\n'
     
    11881191                          '         GROUP BY idTestBox\n'
    11891192                          '       ) AS TestBoxIDs\n'
    1190                           '       INNER JOIN TestBoxesWithStrings\n'
    1191                           '               ON TestBoxesWithStrings.idGenTestBox = TestBoxIDs.idGenTestBox\n'
     1193                          '       LEFT OUTER JOIN TestBoxesWithStrings\n'
     1194                          '                    ON TestBoxesWithStrings.idGenTestBox = TestBoxIDs.idGenTestBox\n'
    11921195                          'ORDER BY TestBoxesWithStrings.sName\n' );
    11931196        aoRet = []
     
    12021205        """
    12031206
     1207        # Using LEFT OUTER JOIN instead of INNER JOIN in case it performs better, doesn't matter for the result.
    12041208        self._oDb.execute('SELECT TestCases.*\n'
    12051209                          'FROM   ( SELECT idTestCase         AS idTestCase,\n'
     
    12091213                          '         GROUP BY idTestCase\n'
    12101214                          '       ) AS TestCasesIDs\n'
    1211                           '       INNER JOIN TestCases ON TestCases.idGenTestCase = TestCasesIDs.idGenTestCase\n'
     1215                          '       LEFT OUTER JOIN TestCases ON TestCases.idGenTestCase = TestCasesIDs.idGenTestCase\n'
    12121216                          'ORDER BY TestCases.sName\n' );
     1217
    12131218        aoRet = [];
    12141219        for aoRow in self._oDb.fetchAll():
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette