(non-PHPdoc)

@see \Core\Data\Db\TableInfoInterface::listTblIndexes()
164251
public function loadIndexes($tbl)
    {
        $this->db->sql('SHOW KEYS FROM `' . $tbl . '`');
        $result = $this->db->all();
        
        $indexes = [];
        
        foreach ($result as $row) {
            
            $name = $row['Key_name'];
            
            // What is the type?
            if ($row['Key_name'] == 'PRIMARY') {
                $type = 'primary';
            }
            elseif (empty($row['Non_unique'])) {
                $type = 'unique';
            }
            elseif (isset($row['Index_type']) && $row['Index_type'] == 'FULLTEXT') {
                $type = 'fulltext';
            }
            else {
                $type = 'index';
            }
            
            // Is it a partial index?
            $column = !empty($row['Sub_part']) ? $row['Column_name'] . '(' . $row['Sub_part'] . ')' : $row['Column_name'];
            
            $this->addIndex($name, $type, $column);
        }
    }
88200
protected function _updateIndexes ($table_name) {
		$seq_in_index = [];

		$this->_indexes[$table_name] = [];

		foreach ($this->getColumns($table_name, true) as $column) {
			if ($column['primary_key']) {
				if (!isset($seq_in_index['PRIMARY'])) {
					$seq_in_index['PRIMARY'] = 1;
				}
				$this->_indexes[$table_name]['PRIMARY'][] = [
					'table_name'		=> $table_name,
					'temporary'			=> null,
					'unique'			=> true,
					'if_not_exists'		=> null,
					'key_name'			=> 'PRIMARY',
					'column_name'		=> $column['column_name'],
					'seq_in_index'		=> $seq_in_index['PRIMARY']++,
					'collation'			=> null,
					'cardinality'		=> null,
					'comment'			=> null,
					'index_comment'		=> null,
					'order'				=> null,
					'index_type'		=> null,
					'sub_part'			=> null,
					'raw_data'			=> null,
				];
			}
		}

		$stmt = $this->prepare('SELECT pis.tablename AS table_name, pis.indexname AS index_name, pa.attname AS column_name, pi.indisunique AS unique, pi.indisprimary AS primary, pis.indexdef AS sql, pam.amname AS hash_type FROM pg_indexes pis, pg_class pc_i, pg_index pi, pg_class pc_t, pg_attribute pa, pg_am pam WHERE pis.schemaname = current_schema() AND pis.tablename = ? AND pc_i.relname IN (pis.indexname) AND pi.indexrelid IN (pc_i.oid) AND pc_t.relname = ? AND pa.attrelid = pc_t.oid AND pa.attnum = ANY(pi.indkey) AND pc_i.relam = pam.oid');
		$stmt->execute([$table_name, $table_name]);
		$stmt->setFetchMode(\PDO::FETCH_ASSOC);
		foreach ($stmt as $index) {
			$name = $index['primary'] ? 'PRIMARY' : $index['index_name'];
			if (!isset($seq_in_index[$name])) {
				$seq_in_index[$name] = 1;
			}
			$this->_indexes[$table_name][$name][] = [
				'table_name'		=> $table_name,
				'temporary'			=> null,
				'unique'			=> $index['unique'],
				'if_not_exists'		=> null,
				'key_name'			=> $name,
				'column_name'		=> $index['column_name'],
				'seq_in_index'		=> $seq_in_index[$name]++,
				'collation'			=> null,
				'cardinality'		=> null,
				'comment'			=> null,
				'index_comment'		=> null,
				'order'				=> null,
				'index_type'		=> null,
				'sub_part'			=> null,
				'raw_data'			=> $index,
			];
		}
	}
598143
protected function createIndexes()
    {
        $this->addPrimaryKey(
            null,
            static::tableName(),
            [
                'elementId',
                'objectId',
                'fieldId',
                'siteId'
            ]
        );
        $this->createIndex(
            null,
            static::tableName(),
            'objectId',
            false
        );
    }
72467
public function loadIndexes($tbl): IndexlistInterface
    {
        $this->db->sql('SHOW KEYS FROM `' . $tbl . '`');
        $result = $this->db->all();

        $indexlist = new Indexlist();

        foreach ($result as $row) {

            $name = $row['Key_name'];

            // What is the type?
            if ($row['Key_name'] == 'PRIMARY') {
                $type = 'primary';
            }
            elseif (empty($row['Non_unique'])) {
                $type = 'unique';
            }
            elseif (isset($row['Index_type']) && $row['Index_type'] == 'FULLTEXT') {
                $type = 'fulltext';
            }
            else {
                $type = 'index';
            }

            $index = new Index();
            $index->setName($name);
            $index->setType($type);

            $indexlist->setIndex($index);

            // Is it a partial index?
            $column = !empty($row['Sub_part']) ? $row['Column_name'] . '(' . $row['Sub_part'] . ')' : $row['Column_name'];

            var_dump($column);

        }

        return $indexlist;
    }
596241
private function buildIndexes() {
        $indexes = array();
        /** @var ResultSet $results */
        $results = $this->getConfiguration()->getConnection()->query('SHOW INDEX FROM `' . $this->getTableName() . '`');
        while($result = $results->fetch()) {
            $result = (object)$result;
            if(!array_key_exists($result->Key_name, $indexes)) {
                $indexes[$result->Key_name] = new Index();
            }
            /** @var Index $index */
            $index = $indexes[$result->Key_name];
            $index->setUnique(!$result->Non_unique);
            $index->addColumn($result->Column_name);
            $index->setPrimary($result->Key_name == 'PRIMARY');
        }
        $this->setIndexes($indexes);
    }
1082572
public function getIndexes( $includeParents = true )
    {

        // lazy load indexes
        if( !isset( $this->indexes ) ) {

            $this->indexes = $this->catalog->pgIndexes->findByIndrelid( $this->oid );

            // are we inheriting off another table
            if( $parent = $this->getParent() ) {

                foreach( $parent->getIndexes() as $parentIndex ) {

                    $data = $parentIndex->all();
                    $data['inherited'] = true;
                    $data['columns'] = [];

                    foreach( $parentIndex->indkey as $indkey ) {
                        $columns[] = sprintf( "%s.%s", $this->oid, $indkey );
                    }

                    $this->indexes->add(
                        new PgIndex( $this->catalog, $data )
                    );

                }

            }

        }

        // include parent indexes
        if( $includeParents ) {
            return $this->indexes->copy();
        } else {
            return $this->indexes->copy()->removeByInherited( true );
        }

    }
1359594
protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
    {
        $indexBuffer = [];
        foreach ($tableIndexes as $tableIndex) {
            $tableIndex = array_change_key_case($tableIndex, CASE_LOWER);

            $keyName = strtolower($tableIndex['name']);
            $buffer  = [];

            if (strtolower($tableIndex['is_primary']) === 'p') {
                $keyName              = 'primary';
                $buffer['primary']    = true;
                $buffer['non_unique'] = false;
            } else {
                $buffer['primary']    = false;
                $buffer['non_unique'] = ! $tableIndex['is_unique'];
            }
            $buffer['key_name']    = $keyName;
            $buffer['column_name'] = $this->getQuotedIdentifierName($tableIndex['column_name']);
            $indexBuffer[]         = $buffer;
        }

        return parent::_getPortableTableIndexesList($indexBuffer, $tableName);
    }
605805
public function listTableIndexes($table)
    {
        $sql = $this->_platform->getListTableIndexesSQL($table, $this->_conn->getDatabase());

        $tableIndexes = $this->_conn->fetchAll($sql);

        return $this->_getPortableTableIndexesList($tableIndexes, $table);
    }
1354168
protected function getListCharFontIndex()
    {
        if ($this->_font) {
            $fontFamily = $this->_font->getFontFamily();
            return $this->_rtf->getFontTable()->getFontIndex($fontFamily);
        }

        return parent::getListCharFontIndex();
    }
1226634
protected function createIndexes()
    {
        $this->createIndex(
            $this->db->getIndexName(
                TransformerRecord::tableName(),
                'handle',
                false,
                true
            ),
            TransformerRecord::tableName(),
            'handle',
            false
        );
        $this->createIndex(
            $this->db->getIndexName(
                TransformerRecord::tableName(),
                'handle',
                false
            ),
            TransformerRecord::tableName(),
            'handle',
            false
        );
        $this->createIndex(
            $this->db->getIndexName(
                TransformerRecord::tableName(),
                'handle,type,scope,context,siteId',
                true
            ),
            TransformerRecord::tableName(),
            'handle,type,scope,context,siteId',
            true
        );
        $this->createIndex(
            $this->db->getIndexName(
                TransformerRecord::tableName(),
                'siteId',
                false,
                true
            ),
            TransformerRecord::tableName(),
            'siteId',
            false
        );
    }
327861
protected function _updateIndexes ($table_name) {
		$this->_indexes[$table_name] = [];
		foreach ($this->query(sprintf('SHOW INDEX FROM %s;', $table_name), \PDO::FETCH_ASSOC) as $index) {
			$this->_indexes[$table_name][$index['Key_name']][] = [
				'table_name'		=> $table_name,
				'temporary'			=> null,
				'unique'			=> !filter_var($index['Non_unique'], \FILTER_VALIDATE_BOOLEAN),
				'if_not_exists'		=> null,
				'key_name'			=> $index['Key_name'],
				'column_name'		=> $index['Column_name'],
				'seq_in_index'		=> $index['Seq_in_index'],
				'collation'			=> $index['Collation'],
				'cardinality'		=> $index['Cardinality'],
				'comment'			=> $index['Comment'],
				'index_comment'		=> $index['Index_comment'],
				'order'				=> null,
				'index_type'		=> $index['Index_type'],
				'sub_part'			=> $index['Sub_part'],
				'raw_data'			=> $index,
			];
		}
	}
689371
def index_list(self):
        '''
        
        '''
        logger.info('Listing indexes')
        _ix = {}
        _i = self.inspector
        for tbl in _i.get_table_names():
            _ix.setdefault(tbl, [])
            for ix in _i.get_indexes(tbl):
                _ix[tbl].append(ix)
        return _ix
825994
public function printAllTableIdFlds($tbl, $flds = [])
    {
        $ret = '';
        $arr = $this->getAllTableIdFlds($tbl, $flds);
        if (sizeof($arr) > 0) {
            foreach ($arr as $i => $row) {
                $ret .= ' (( ';
                if (sizeof($row) > 0) {
                    foreach ($row as $fld => $val) {
                        $ret .= (($fld != 'id') ? ' , ' : '') . $fld . ' : ' . $val;
                    }
                }
                $ret .= ' )) ';
            }
        }
        return $ret;
    }
678200
@Deprecated
    public List<Index> listIndices() {
        InputStream response = null;
        try {
            URI uri = new DatabaseURIHelper(db.getDBUri()).path("_index").build();
            response = client.couchDbClient.get(uri);
            return getResponseList(response, client.getGson(), DeserializationTypes.INDICES);
        } finally {
            close(response);
        }
    }
685147
private function loadIndexes(): void
    {
        if (null !== $this->gsi) {
            return;
        }

        $this->gsi = [];
        foreach ($this->getIndexes() as $gsi) {
            $this->gsi[$gsi->getAlias()] = $gsi;
        }
    }
174102
protected function buildIndex(): array
    {
        $file = $this->getFile($this->getStoragePath());
        $modified = $file->modified();

        $this->data = (array) $file->content();

        $list = [];
        foreach ($this->data as $key => $info) {
            $list[$key] = [
                'storage_key' => $key,
                'storage_timestamp' => $modified
            ];
        }

        return $list;
    }
925752
private function getCreatedIndexes(Table $oldTable, Table $newTable)
    {
        $createdIndexes = array();

        foreach ($newTable->getFilteredIndexes() as $index) {
            if (!$oldTable->hasIndex($index->getName())
                || $this->compareIndexes($oldTable->getIndex($index->getName()), $index)) {
                $createdIndexes[] = $index;
            }
        }

        return $createdIndexes;
    }