final protected function process(\SelectQuery $select, Query $query)
    {
        $sortOrder = Query::SORT_DESC === $query->getSortOrder() ? 'desc' : 'asc';
        if ($query->hasSortField()) {
            $select->orderBy($query->getSortField(), $sortOrder);
        }
        $select->orderBy($this->getPredictibleOrderColumn(), $sortOrder);

        if ($searchString = $query->getSearchString()) {
            $select->condition('n.title', '%' . db_like($searchString) . '%', 'LIKE');
        }

        // Also add a few joins,  that might be useful later
        if ($query->has('history_user_id')) {
            $select->leftJoin('history', 'h', "h.nid = n.nid AND h.uid = :history_uid", [':history_uid' => $query->get('history_user_id')]);
        } else {
            $select->leftJoin('history', 'h', "h.nid = n.nid AND 1 = 0");
        }

        // This is where it potentially gets ugly in term of performance
        if ($query->has('revision_user_id')) {
            $revSelect = $this
                ->database
                ->select('node_revision', 'r')
                ->condition('r.uid', $query->has('revision_user_id'))
                ->where("r.nid = n.nid")
                ->range(0, 1)
            ;
            $revSelect->addExpression('1');

            $select->exists($revSelect);
        }

        $this->applyFilters($select, $query);

        /** @var \MakinaCorpus\Drupal\Calista\Datasource\QueryExtender\DrupalPager $pager */
        $this->pager = $select->extend(DrupalPager::class);
        $this->pager->setDatasourceQuery($query);

        return $this->pager;
    }