public function execute($params = null)
    {
        $t = microtime(true);
        $query = new LoggedQuery();

        try {
            $result = parent::execute($params);
        } catch (Exception $e) {
            $e->queryString = $this->queryString;
            $query->error = $e;
            $this->_log($query, $params, $t);
            throw $e;
        }

        $query->numRows = $this->rowCount();
        $this->_log($query, $params, $t);

        return $result;
    }