mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 10:16:00 +00:00
sql server index analyser works
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
module.exports = `
|
||||
select c.object_id, c.index_id, c.column_id, c.is_descending_key, c.is_included_column from sys.index_columns c
|
||||
|
||||
select
|
||||
c.object_id, c.index_id, c.column_id,
|
||||
col.name as columnName,
|
||||
c.is_descending_key as isDescending, c.is_included_column as isIncludedColumn
|
||||
from sys.index_columns c
|
||||
inner join sys.columns col on c.object_id = col.object_id and c.column_id = col.column_id
|
||||
where c.object_id =OBJECT_ID_CONDITION
|
||||
order by c.key_ordinal
|
||||
|
||||
`;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module.exports = `
|
||||
select i.object_id as objectId, i.name as constraintName, i.type_desc, i.is_unique as isUnique,i.index_id, i.is_unique_constraint from sys.indexes i
|
||||
select i.object_id, i.name as constraintName, i.type_desc as indexType, i.is_unique as isUnique,i.index_id, i.is_unique_constraint from sys.indexes i
|
||||
where i.is_primary_key=0
|
||||
and i.is_hypothetical=0 and indexproperty(i.object_id, i.name, 'IsStatistics') = 0
|
||||
and objectproperty(i.object_id, 'IsUserTable') = 1
|
||||
|
||||
Reference in New Issue
Block a user