This seems to cause massive table-locks for long threads.PHP Code:select count(*) as preposts
from " . vbseo_tbl_prefix('post') . " p
LEFT JOIN " . vbseo_tbl_prefix('deletionlog') . " AS deletionlog ON(deletionlog.primaryid = p.postid AND type = 'post')
where
deletionlog.primaryid IS NULL
AND p.threadid='" . $post['threadid'] . "'
AND p.visible=1
AND p.dateline " . (($bbuserinfo['postorder'] == 0) ? '<=' : '>=') . $post['dateline'] . "
Make a JOIN on deletionlog seems really pointless here, as p.visible = 1 already selects only those threads that are not deleted, eg. deletionlog.primaryid will alway be NULL here.
vBulletin itself removed has such JOINs in 3.0.X, but they were since removed to avoid such issues.


LinkBack URL
About LinkBacks





Reply With Quote
