Fork me on GitHub
Subscribe 3

Ticket #632 (fixed enhancement)

Post.php performance hack large boards

  • Created: 2012-02-22 16:45:20
  • Reported by: Newman
  • Assigned to: Oldskool
  • Milestone: 1.4.9
  • Component: performance
  • Priority: normal

POST.php find:

$db->query('UPDATE '.$db->prefix.'topics SET num_replies='.$num_replies.',

replace with:

$db->query('UPDATE '.$db->prefix.'topics SET num_replies=num_replies+1,

delete :

$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$tid) or error('Unable to fetch post count for topic', __FILE__, __LINE__, $db->error());
			$num_replies = $db->result($result, 0) - 1;

There is no need for that query to run, will save performance in larger boards only.

For reference: http://fluxbb.org/forums/viewtopic.php?id=6114

History

Franz 2012-02-22 17:03:21

  • Component usability removed.
  • Description changed. (Diff)
  • Milestone set to 1.4.9.
  • Priority changed from high to normal.
  • Type changed from bug to enhancement.

Franz 2012-02-22 17:04:00

  • Component set to performance.

Oldskool 2012-03-30 12:09:47

  • Owner set to Oldskool.

Oldskool 2012-03-30 13:05:26

Commit 5f63ac3 to fluxbb fluxbb-1.4

#632 - More efficient way of updating the post count.

Oldskool 2012-03-30 13:07:12

  • Status changed from open to fixed.

All set, thanks for pointing this out Newman!