Hi Guys,
How could I know the indexes of a mysql table has ?
Hi Guys,
How could I know the indexes of a mysql table has ?
oVer := oServer:Query("SHOW INDEX FROM " + cTable + ";")//Para una tabla
SELECT DISTINCT
TABLE_NAME,
INDEX_NAME
FROM INFORMATION_SCHEMA.STATISTICS
WHERE TABLE_NAME = 'retalcal';
//Para todas las tablas de una BDD
SELECT DISTINCT
TABLE_NAME,
INDEX_NAME
FROM INFORMATION_SCHEMA.STATISTICS
WHERE TABLE_SCHEMA = 'fapsoftware';Thank you ![]()
vilian wrote:Hi Guys,
How could I know the indexes of a mysql table has ?
aIndexes := oCn:ListIndexes( cTable )Thank you ![]()
nageswaragunupudi wrote:vilian wrote:Hi Guys,
How could I know the indexes of a mysql table has ?
aIndexes := oCn:ListIndexes( cTable )
Is there any function to create index?
METHOD MakePrimaryKey( cTable, cCol )nageswaragunupudi wrote:Is there any function to create index?
No.
Not exactly but this function automatically creates a primary key index:
METHOD MakePrimaryKey( cTable, cCol )
Do you mean we don't need index other than a primary key?
oCn:Execute( "CREATE UNIQUE INDEX cust_name_uidx ON cust( name )" )oCn:Execute( "CREATE INDEX ON employee_sex_idx ON employee( sex )" )Wouldn't it be better to index the connection variables of detail tables and master table?