check all indexes on table
SELECT
tablename,
indexname,
indexdef
FROM
pg_indexes
WHERE
schemaname = 'yourschema' and tablename='yourtable'
ORDER BY
tablename,
indexname;
(POSTRGRESQL)
check all indexes on table
SELECT
tablename,
indexname,
indexdef
FROM
pg_indexes
WHERE
schemaname = 'yourschema' and tablename='yourtable'
ORDER BY
tablename,
indexname;
(POSTRGRESQL)
check index sql server
create procedure _ListIndexes(@tableName nvarchar(200))
as
begin
/*
exec _ListIndexes '<YOUR TABLE NAME>'
*/
SELECT DB_NAME(DB_ID()) as DBName,SCH.name + '.' + TBL.name AS TableName,IDX.name as IndexName, IDX.type_desc AS IndexType,COL.Name as ColumnName,IC.*
FROM sys.tables AS TBL
INNER JOIN sys.schemas AS SCH ON TBL.schema_id = SCH.schema_id
INNER JOIN sys.indexes AS IDX ON TBL.object_id = IDX.object_id
INNER JOIN sys.index_columns IC ON IDX.object_id = IC.object_id and IDX.index_id = IC.index_id
INNER JOIN sys.columns COL ON ic.object_id = COL.object_id and IC.column_id = COL.column_id
where TBL.name = @tableName
ORDER BY TableName,IDX.name
end
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us