Metadata Indexes
Metadata Indexes
This operation returns information about available indexes.
Request
GET https://cloud.cdata.com/api/indexes
Query String Parameters
Parameter | Description | Notes |
catalogName | Restricts results to the specified catalog. | Optional |
schemaName | Restricts results to the specified schema. | Optional |
tableName | Restricts results to the specified table. | Optional |
indexName | Restricts results to the specified index. | Optional |
unique | -If true, only return unique. | Optional |
-If false, only return non-unique. | ||
-Default is return all. |
Response
HTTP 200 OK
{
"results": [
{
"affectedRows": -1,
"schema": [
{
"catalogName": "CData",
"columnLabel": "TABLE_CATALOG",
"columnName": "TABLE_CATALOG",
"dataType": 5,
"dataTypeName": "VARCHAR",
"length": 255,
"nullable": true,
"ordinal": 0,
"precision": 255,
"scale": 0,
"schemaName": "QueryFederation",
"tableName": "sys_indexes"
},
{
"catalogName": "CData",
"columnLabel": "TABLE_SCHEMA",
"columnName": "TABLE_SCHEMA",
"dataType": 5,
"dataTypeName": "VARCHAR",
"length": 255,
"nullable": true,
"ordinal": 1,
"precision": 255,
"scale": 0,
"schemaName": "QueryFederation",
"tableName": "sys_indexes"
},
{
"catalogName": "CData",
"columnLabel": "TABLE_NAME",
"columnName": "TABLE_NAME",
"dataType": 5,
"dataTypeName": "VARCHAR",
"length": 512,
"nullable": true,
"ordinal": 2,
"precision": 512,
"scale": 0,
"schemaName": "QueryFederation",
"tableName": "sys_indexes"
},
{
"catalogName": "CData",
"columnLabel": "INDEX_NAME",
"columnName": "INDEX_NAME",
"dataType": 5,
"dataTypeName": "VARCHAR",
"length": 255,
"nullable": true,
"ordinal": 3,
"precision": 255,
"scale": 0,
"schemaName": "QueryFederation",
"tableName": "sys_indexes"
},
{
"catalogName": "CData",
"columnLabel": "COLUMN_NAME",
"columnName": "COLUMN_NAME",
"dataType": 5,
"dataTypeName": "VARCHAR",
"length": 255,
"nullable": true,
"ordinal": 4,
"precision": 255,
"scale": 0,
"schemaName": "QueryFederation",
"tableName": "sys_indexes"
},
{
"catalogName": "CData",
"columnLabel": "IS_UNIQUE",
"columnName": "IS_UNIQUE",
"dataType": 14,
"dataTypeName": "BIT",
"length": 5,
"nullable": true,
"ordinal": 5,
"precision": 1,
"scale": 0,
"schemaName": "QueryFederation",
"tableName": "sys_indexes"
},
{
"catalogName": "CData",
"columnLabel": "IS_PRIMARY",
"columnName": "IS_PRIMARY",
"dataType": 14,
"dataTypeName": "BIT",
"length": 5,
"nullable": true,
"ordinal": 6,
"precision": 1,
"scale": 0,
"schemaName": "QueryFederation",
"tableName": "sys_indexes"
},
{
"catalogName": "CData",
"columnLabel": "TYPE",
"columnName": "TYPE",
"dataType": 7,
"dataTypeName": "SMALLINT",
"length": 6,
"nullable": true,
"ordinal": 7,
"precision": 5,
"scale": 0,
"schemaName": "QueryFederation",
"tableName": "sys_indexes"
},
{
"catalogName": "CData",
"columnLabel": "SORT_ORDER",
"columnName": "SORT_ORDER",
"dataType": 5,
"dataTypeName": "VARCHAR",
"length": 255,
"nullable": true,
"ordinal": 8,
"precision": 255,
"scale": 0,
"schemaName": "QueryFederation",
"tableName": "sys_indexes"
},
{
"catalogName": "CData",
"columnLabel": "ORDINAL_POSITION",
"columnName": "ORDINAL_POSITION",
"dataType": 7,
"dataTypeName": "SMALLINT",
"length": 6,
"nullable": true,
"ordinal": 9,
"precision": 5,
"scale": 0,
"schemaName": "QueryFederation",
"tableName": "sys_indexes"
}
],
"rows": [
[
"Salesforce1",
"Salesforce",
"Contact",
"CDATA_SALESFORCE_CONTACT_EXTERNALCONTACTREFERENCE_KJT__C_INDEX",
"ExternalContactReference_KJT__c",
true,
false,
3,
"A",
0
],
[
"Salesforce1",
"Salesforce",
"Contact",
"CDATA_SALESFORCE_CONTACT_PRIMARYKEY_INDEX",
"Id",
true,
true,
3,
"A",
0
],
[
"Salesforce1",
"Salesforce",
"Contact",
"CDATA_SALESFORCE_CONTACT_NAME_INDEX",
"Name",
false,
false,
3,
"A",
0
]
]
}
]
}
Fields
Column | Data Type | Description |
TABLE_CATALOG | String | The catalog name. |
TABLE_SCHEMA | String | The schema name. |
TABLE_NAME | String | The table name. |
INDEX_NAME | String | The index name. |
COLUMN_NAME | String | The column name. |
IS_UNIQUE | Boolean;nullable | Whether it is a unique index. |
IS_PRIMARY | Boolean;nullable | Whether it is a primary index. |
TYPE | Integer | The type of index. (See notes, below.) |
SORT_ORDER | String | A for ascending, D for descending. |
ORDINAL_POSITION | Integer | The position of the column within the index (1-based). |
- Possible values for TYPE are:
- IndexType.Statistic (0)
- IndexType.Clustered (1)
- IndexType.Hashed (2)
- IndexType.Other (3)