Class to manager MYSQL for Harbour/xHarbour
Custom Search

jueves, 23 de septiembre de 2010

Obtener informacion de los indices de la tabla / Get index information from table

Para obtener la informacuion detallada de los indices de una tabla, puedes ejecutar el siguiente "query"
For detailed information indexes created on table, you can execute following  Query:

SHOW INDEX FROM table_name;
Descripcion de los campos ( Tomados del sitio oficial de MySql)
Description of fields (help taken from Mysql website):


se veria algo asi/Look some like that




Table
Nombre de la Tabla 
The name of the table.

Non_unique
0 si el índice no puede contener duplicados, 1 si puede. /
0 if the index cannot contain duplicates, 1 if it can.

Key_name
Nombre del Indice 
The name of the index.

Seq_in_index
Número de secuencia de columna en el índice, comenzando con 1. / 
The column sequence number in the index, starting with 1.

Column_name
Nombre de columna / 
The column name.

Collation
Cómo se ordena la columna en el índice. En MySQL, puede tener valores 'A' (Ascendente) o NULL (No ordenado). /
How the column is sorted in the index. In MySQL, this can have values “A” (Ascending) or NULL (Not sorted).

Cardinality
Número de valores únicos en el índice. Se actualiza ejecutando ANALYZE TABLE o myisamchk -a. Cardinalityse cuenta basándose en las estadísticas almacenadas como enteros, así que no es necesariamente precisa para tablas pequeñas. Mientras más grande sea, más grande es la probabilidad que MySQL use el índice al hacer joins.
An estimate of the number of unique values in the index. This is updated by running ANALYZE TABLE or myisamchk -a. Cardinality is counted based on statistics stored as integers, so the value is not necessarily exact even for small tables. The higher the cardinality, the greater the chance that MySQL uses the index when doing joins.
Sub_part
Número de caracteres indexados si la columna sólo está indexada parcialmente. NULL si la columna entera está indexada/
The number of indexed characters if the column is only partly indexed, NULL if the entire column is indexed.

Packed
Indica cómo está empaquetada la clave. NULL si no lo está.
Indicates how the key is packed. NULL if it is not.

Null
Contiene YES si la columna puede contener NULL. Si no, la columna contiene NO/
Contains YES if the column may contain NULL values and ” if not.

Index_type
Método de índice usado (BTREE, FULLTEXT, HASH, RTREE).
The index method used (BTREE, FULLTEXT, HASH, RTREE).

Comment.
Comentarios Varios
Various remarks.

No hay comentarios:

Publicar un comentario