diff options
author | jasonmarlin <jason.marlin@gmail.com> | 2019-01-17 20:27:10 -0500 |
---|---|---|
committer | jasonmarlin <jason.marlin@gmail.com> | 2019-01-17 20:27:10 -0500 |
commit | a0f1ec852a987fb587cc07dc6910000c925db50d (patch) | |
tree | 0eedfc1a9c2fe056cb044e06164c130a490d031b /phpBB | |
parent | cffdc8efff9f0c66e6640a42fc375b4662b44180 (diff) | |
download | forums-a0f1ec852a987fb587cc07dc6910000c925db50d.tar forums-a0f1ec852a987fb587cc07dc6910000c925db50d.tar.gz forums-a0f1ec852a987fb587cc07dc6910000c925db50d.tar.bz2 forums-a0f1ec852a987fb587cc07dc6910000c925db50d.tar.xz forums-a0f1ec852a987fb587cc07dc6910000c925db50d.zip |
[ticket/15941] Replace MAX SQL in functions_posting.php
Replace MAX SQL function with faster query using order by and limit.
The ajacent query could also be optimized to eliminate the usage of MAX.
Note that adding a compound key as suggested by EXPLAIN SQL yields an
improvement, but not nearly as fast as ORDER + LIMIT.
PHPBB3-15941
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions_posting.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 3640f543d9..8ca483f53a 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -200,7 +200,7 @@ function update_post_information($type, $ids, $return_update_sql = false) $topic_condition = ''; } - if (count($ids) == 1) + if (count($ids) === 1) { $sql = 'SELECT p.post_id as last_post_id FROM ' . POSTS_TABLE . " p $topic_join |