TYPO3 v8 QueryBuilder indexBy方法

Im trying to build an SELECT statement with the QueryBuilder.

I need the uids as Index. But how can I build this with the QueryBuilder. ->indexBy("uid") doesnt work for me:

      $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
            ->getQueryBuilderForTable($table);

        $queryBuilder
            ->getRestrictions()
            ->removeByType(StartTimeRestriction::class)
            ->removeByType(EndTimeRestriction::class);

        $sql = $queryBuilder
            ->select("vac_id", "uid", "pid", "hash")
            ->from($table)
            ->execute()
            ->fetchAll();