Query Index In a table

查看一个表的Index info

1,Script1

--query index in a table

select o.name,o.object_id,
    i.name as indexname,i.index_id,i.type_desc,
    ic.column_id,ic.is_included_column,ic.key_ordinal as Index_column_Ordinal,
    c.name as columnname
from sys.objects o
inner join sys.indexes i on o.object_id=i.object_id
inner join sys.index_columns ic on i.object_id=ic.object_id and i.index_id=ic.index_id
inner join sys.columns c on o.object_id=c.object_id  and ic.column_id=c.column_id
where o.name=‘FactProduct‘
order by i.index_id

2,Script2

--query index in a table include filter index

select o.name,o.object_id,
    i.name as indexname,i.index_id,i.type_desc,
    ic.column_id,ic.is_included_column,ic.key_ordinal as Index_column_Ordinal,
    c.name as columnname,
    i.has_filter,i.filter_definition
from sys.objects o
inner join sys.indexes i on o.object_id=i.object_id
inner join sys.index_columns ic on i.object_id=ic.object_id and i.index_id=ic.index_id
inner join sys.columns c on o.object_id=c.object_id  and ic.column_id=c.column_id
where o.name=‘factProduct‘
order by i.index_id
时间: 2024-11-05 12:24:21

Query Index In a table的相关文章

create index 与 alter table add index 区别

众所周知,MySQL创建索引有两种语法,即:ALTER TABLE HeadOfState ADD INDEX (LastName, FirstName);CREATE INDEX index_name HeadOfState (LastName, FirstName);那么,这两种语法有什么区别呢? 在网上找了一下,在一个英文网站上,总结了下面几个区别,我翻译出来,如下:1.CREATE INDEX必须提供索引名,对于ALTER TABLE,将会自动创建,如果你不提供:2.CREATE IND

2743711 - Possible Unexpected Results When Using Query With an ORDER BY Clause on a Rowstore Table With a Parallelized Search on a Cpbtree-Type Index

2743711 - Possible Unexpected Results When Using Query With an ORDER BY Clause on a Rowstore Table With a Parallelized Search on a Cpbtree-Type Index Version 14 from May 28, 2019 in English Show Changes Symptom A query on a rowstore table containing

转:Sql Server中的表访问方式Table Scan, Index Scan, Index Seek

0.参考文献 Table Scan, Index Scan, Index Seek SQL SERVER – Index Seek vs. Index Scan – Diffefence and Usage – A Simple Note oracle表访问方式 Index Seek和Index Scan的区别以及适用情况 1.oracle中的表访问方式 在oracle中有表访问方式的说法,访问表中的数据主要通过三种方式进行访问: 全表扫描(full table scan),直接访问数据页,查找

[Hive - LanguageManual] Create/Drop/Alter View Create/Drop/Alter Index Create/Drop Function

Create/Drop/Alter View Create View Drop View Alter View Properties Alter View As Select Version information Icon View support is only available in Hive 0.6 and later. Create View CREATE VIEW [IF NOT EXISTS] view_name [(column_name [COMMENT column_com

Mysql空间数据,空间索引,Spatial Data,Spatial Index

前文: 这两天因为项目原因看了一下MySQL的空间索引,发现网上的资料不多,查了一下官方文档,为了强化记忆做了一个简单的翻译.基本上理解了mysql空间索引的要点.谨以此纪. Extensions for Spatial Data Open Geospatial Consortium (OGC) 是一个由超过两百五十个公司,机构,大学组成的致力于发展管理空间数据的解决方案的组织. OGC 发布了OpenGIS® Implementation Standard for Geographic inf

Query runs slow via .NET

Slow in the Application, Fast in SSMS?Understanding Performance Mysteries An SQL text by Erland Sommarskog, SQL Server MVP. Last revision: 2013-08-30.This article is also available in Russian, translated by Dima Piliugin. Introduction When I read var

Index Condition Pushdown Optimization

Index Condition Pushdown (ICP) is an optimization for the case where MySQL retrieves rows from a table using an index(ICP是MySQL用索引从表中获取数据的一种优化). Without ICP, the storage engine traverses the index to locate rows in the base table and returns them to

Partition Table 查询性能

分区表的高效的查询性能是基于Partition Elimination 和 Partition Parallelism实现的.Partition Elimination 是指在执行TSql查询的时候,不是seek表的所有分区,而是根据Partition column排除部分分区,在符合 filtering the partition column 条件的 partition 上进行查询.Partition Parallelism是指分区之间可以并发执行查询.分区表查询使用更小的查询范围,更高的并

分区表的 Aligned Index

Aligned Index 是指索引结构的分区和Table的分区相同,即在表的一个分区建立的索引,索引的Leaf Data 也在同一个分区中. Partition column 是个关键的table column,影响index的对齐. There are a number of important considerations for creating indexes and constraints on a partitioned table. Table partitioning can