Review main Merged

32062[TASK] Change fetch of maximum version using LEFT JOIN

Andreas Kienast CR +2 V +2 Easy +15 −14 updated 08/20/14, 21:04

Commit message

Currently, the method fetchMaximalVersionsForAllExtensions uses a
subselect to determine the highest available version. This solution is
rather inefficient and incomptabile to DBAL. The query is replaced by
a LEFT JOIN.

Review

  • Code review CR +2
    • Jigal van Hemert +2
    • Markus Klein +1
    • Wouter Wolters +1
    • Stefan Froemken +1
  • Verified V +2
    • Jigal van Hemert +2
    • Wouter Wolters +1

Issues 1

Files 1

Review log 26

Show 1 earlier messages
  1. Andreas Kienast uploaded patch set 1 08/08/14, 12:04

  1. Andreas Kienast uploaded patch set 2 08/08/14, 12:31

  2. Andreas Kienast uploaded patch set 3 08/08/14, 12:39

  3. Andreas Kienast uploaded patch set 4 08/08/14, 12:41

  4. Andreas Kienast uploaded patch set 5 08/08/14, 13:06

  5. Oliver Klee commented on patch set 5 08/10/14, 11:59

    ExtensionRepository.php:309

    $res -> $queryResult (to avoid the abbreviation "res")

    ExtensionRepository.php:318

    Space missing after while.
  6. Andreas Kienast uploaded patch set 6 08/11/14, 06:10

  7. Markus Klein commented on patch set 6 08/11/14, 10:06

    ExtensionRepository.php:313

    Why the IS NULL check? What is this good for?
  8. Andreas Kienast commented on patch set 6 08/11/14, 10:14

    ExtensionRepository.php:313 Reply

    If a.integer_version is the highest value, there is no b.integer_version with a greater value obviously, so b.extension_key is NULL. It's described here: http://dev.mysql.com/doc/refman/5.5/en/example-maximum-column-group-row.html
  9. Markus Klein commented on patch set 6 CR +1 08/11/14, 11:09

    Oh clear now, I forgot that LEFT JOIN is implicitly a OUTER join
  10. Xavier Perseguers commented on patch set 6 08/11/14, 13:15

    ExtensionRepository.php:302

    The PHP comment should get updated since a subselect is not performed anymore but a more optimal LEFT OUTER JOIN is done instead
  11. Andreas Kienast commented on patch set 6 08/11/14, 13:16

    ExtensionRepository.php:302 Reply

    You're right, I'll fix this herp derp now.
  12. Andreas Kienast uploaded patch set 7 08/11/14, 13:21

  13. Stefan Froemken commented on patch set 7 CR +1 08/13/14, 08:48

    SHOW profiles results in 2.23278600 for the old query and only 1.37893400 for the new query. Both with SQL_NO_CACHE. Good work.
  14. Markus Klein voted on patch set 7 CR +1 08/13/14, 09:10

  15. Andreas Kienast uploaded patch set 8 08/14/14, 06:52

  16. Andreas Kienast commented on patch set 8 08/14/14, 06:54

    Patchset #7 failed with Oracle, ADOdb put the $repositoryUid in b.repository in double quotes, but it must be single quotes.
  17. Andreas Kienast updated the commit message in patch set 9 08/14/14, 07:01

  18. Stefan Froemken voted on patch set 9 CR +1 08/14/14, 07:04

  19. Jigal van Hemert commented on patch set 9 CR +1 08/14/14, 19:29

    I don't like raw queries in general, but in this case it's the best solution. Will test later.
  20. Markus Klein voted on patch set 9 CR +1 08/14/14, 22:15

  21. Jigal van Hemert commented on patch set 9 CR +2 V +1 08/20/14, 18:07

    The order by isn't in the original query, but it's still faster and DBAL compatible!
  22. Wouter Wolters commented on patch set 9 V +1 CR +1 08/20/14, 18:18

    Is the ORDER BY really needed here then?
  23. Jigal van Hemert commented on patch set 9 V +2 08/20/14, 21:03

    > Is the ORDER BY really needed here then? No, it's not needed. It isn't a very efficient sorting either (EXPLAIN says it triggers a filesort). Still, it's faster than the original solution and DBAL compatible. The result is used in an IN() clause so it will safe the DB a bit of sorting later on. We can test later if it's worth it to remove the ORDER BY. I'll merge this now for DBAL compatibility.
  24. Jigal van Hemert merged patch set 9 08/20/14, 21:03

  25. Jigal van Hemert commented on patch set 10 08/20/14, 21:04

    Cherry Picked This patchset was cherry picked to branch TYPO3_6-2 as commit 281053101367ebc96498d90dbe1a4c1c2a0f5376