Performance improvements to version and application classes. Reduce the amount of queries to

what is necessary during object creation.  The only use of all but one of the arrays we were fetching
during version and application construction was in ::delete() so we can just retrieve them there.
Speed screenshot class up by only querying for necessary columns, not select *
This commit is contained in:
Chris Morgan
2006-07-09 00:48:33 +00:00
committed by WineHQ
parent d06cba3977
commit 0a9f8cc155
5 changed files with 148 additions and 138 deletions

View File

@@ -187,6 +187,16 @@ class Comment {
return false;
}
function get_comment_count_for_versionid($iVersionId)
{
$sQuery = "SELECT count(*) as cnt from appComments where versionId = '?'";
$hResult = query_parameters($sQuery, $iVersionId);
if(!$hResult) return 0;
$oRow = mysql_fetch_object($hResult);
return $oRow->cnt;
}
/**
* class static functions
*/