mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
[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
This commit is contained in:
parent
cffdc8efff
commit
a0f1ec852a
1 changed files with 1 additions and 1 deletions
|
@ -200,7 +200,7 @@ function update_post_information($type, $ids, $return_update_sql = false)
|
||||||
$topic_condition = '';
|
$topic_condition = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($ids) == 1)
|
if (count($ids) === 1)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT p.post_id as last_post_id
|
$sql = 'SELECT p.post_id as last_post_id
|
||||||
FROM ' . POSTS_TABLE . " p $topic_join
|
FROM ' . POSTS_TABLE . " p $topic_join
|
||||||
|
|
Loading…
Add table
Reference in a new issue