protected function recordQueryProfile($query, $timer)
    {
        if (!isset($this->queriesProfiling[$query])) {
            $this->queriesProfiling[$query] = array('sum_time_ms' => 0, 'count' => 0);
        }

        $time  = $timer->getTimeMs(2);
        $time += $this->queriesProfiling[$query]['sum_time_ms'];
        $count = $this->queriesProfiling[$query]['count'] + 1;

        $this->queriesProfiling[$query] = array('sum_time_ms' => $time, 'count' => $count);
    }