counting on primary key should be slightly faster...

git-svn-id: file:///svn/phpbb/trunk@5979 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-05-28 16:06:58 +00:00
parent d794557825
commit 2f4c3ea0be

View file

@ -239,7 +239,7 @@ if (!($topic_data = $db->sql_fetchrow($result)))
// This is for determining where we are (page) // This is for determining where we are (page)
if ($post_id) if ($post_id)
{ {
$sql = "SELECT COUNT(*) AS prev_posts $sql = "SELECT COUNT(p.post_id) AS prev_posts
FROM " . POSTS_TABLE . " p FROM " . POSTS_TABLE . " p
WHERE p.post_approved = 1 WHERE p.post_approved = 1
AND p.topic_id = {$topic_data['topic_id']} AND p.topic_id = {$topic_data['topic_id']}