protected function prepareSubquerySelect(Select $select) {
		$select->reset(Select::LIMIT_OFFSET)
		       ->reset(Select::LIMIT_COUNT)
		       ->reset(Select::ORDER);

		$countSelect = $select->getAdapter()->select()
			->from($select)
			->reset(Select::COLUMNS)
			->columns([self::COUNT_COLUMN => 'count(1)']);

		return $countSelect;
	}