Deep optimization

This commit is contained in:
Rudi Grinberg 2012-10-19 13:22:00 -04:00
parent 6d1b8fe586
commit a1e653b41f
2 changed files with 25 additions and 3 deletions

View file

@ -662,6 +662,27 @@ SQL;
}
public static function getContentCount($p_start, $p_end)
{
$sql = <<<SQL
SELECT instance_id,
count(*) AS instance_count
FROM cc_schedule
WHERE ends > :p_start::TIMESTAMP
AND starts < :p_end::TIMESTAMP
GROUP BY instance_id;
SQL;
$counts = Application_Common_Database::prepareAndExecute( $sql, array(
':p_start' => $p_start->format("Y-m-d G:i:s"),
':p_end' => $p_end->format("Y-m-d G:i:s"))
, 'all');
return $counts;
}
public function showEmpty()
{
$sql = <<<SQL