Dear all:
I had put "partition_show" before . but this time it makes faster.

partition_show:

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create view [dbo].[partition_show]
as
WITH tobjectid AS
(
select t.object_id from sys.tables as t inner join sys.indexes
as i on t.object_id=i.object_id and i.type in (0,1) inner join sys.partition_schemes ps
on i.data_space_id=ps.data_space_id
)
SELECT distinct OBJECT_NAME(T2.object_id) TABLE_NAME
,T1.partition_number
,T4.name as "function_name"
,T3.name as "schema_name"
,T7.name File_group_name
,T1.rows
,CASE boundary_value_on_right
WHEN 1 THEN 'less than'
ELSE 'less than or equal to ' END as 'comparision'
--,CONVERT(varchar(100), T5.value, 112) value
,T5.value value
FROM sys.partitions T1
INNER JOIN sys.indexes T2
ON T1.object_id = T2.object_id
INNER JOIN sys.partition_schemes T3
ON T2.data_space_id = T3.data_space_id
INNER JOIN sys.partition_functions T4
ON T3.function_id = T4.function_id
LEFT JOIN sys.partition_range_values T5
ON T4.function_id = T5.function_id
AND T1.partition_number = T5.boundary_id
INNER JOIN sys.destination_data_spaces T6
ON T6.partition_scheme_id = T3.data_space_id
AND T6.destination_id = T1.partition_number
INNER JOIN sys.filegroups T7
ON T6.data_space_id = T7.data_space_id
/*where T2.object_id in (select OBJECT_ID(t.name) from sys.tables as t inner join sys.indexes as i on t.object_id=i.object_id and i.type in (0,1) inner join sys.partition_schemes ps on i.data_space_id=ps.data_space_id) */
where T2.object_id in (select object_id from tobjectid)
AND T1.index_id<=1
GO

partition_show , a new version to check partition table status in sqlserver的更多相关文章

  1. sqlserver partitition and partition table --- partition show

    I can not believe that I had done this about two years Now we know there is totally different betwee ...

  2. Mycat+Mysql 插入数据报错 i[Err] 1064 - partition table, insert must provide ColumnList

    使用Navicat连接Mycat 8066 成功插入了分库表和全局表 1.全局表 sql如下: '); '); '); 插入成功! 2.分库表 sql如下: ', null, null, null, ...

  3. WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

    在 mkfs.ext4 /dev/sda2 格式化硬盘空间时,可能出现这种错误. had this situation at office where I was told to re-partiti ...

  4. WARNING: Re-reading the partition table failed with error 22: Invalid argument

    在划分磁盘分区时,遇到错误"WARNING: Re-reading the partition table failed with error 22: Invalid argument&qu ...

  5. 【问题解决方案】之 jmeter启动报错:Not able to find Java executable or version. Please check your Java installation

    故事发生在云计算实验课上-- ** 故事发生在云计算实验课上-- Step 1 在Xshell中登录自己的cloud虚拟机后,<sudo su ->切换到root用户 Step 2 < ...

  6. oracle partition table 分区表详解

    Oracle partition table 分区表详解 分区表就是通过使用分区技术,将一张大表,拆分成多个表分区(独立的segment),从而提升数据访问的性能,以及日常的可维护性.分区表中,每个分 ...

  7. 计算机启动出现 Invalid Partition Table

    计算机启动出现 Invalid Partition Table 解决办法 使用大白菜启动盘进入临时系统,打开程序DiskGenius 如果系统盘(一般为 C 盘)非活动状态,先激活 如果装系统的硬盘不 ...

  8. 小米2s线刷出现remote: partition table doesn't exist

    =================问题============ 小米2s线刷出现remote: partition table doesn't exist =================解决方案= ...

  9. GUID Partition Table (GPT)

    https://en.wikipedia.org/wiki/GUID_Partition_Table https://zh.wikipedia.org/wiki/全局唯一标识分区表 GUID Part ...

随机推荐

  1. 红帽RHCE培训-课程2笔记目录

    目录 1 kickstart自动安装 DHCP+TFTP(syslinux) +FTP +KICKSTART ~/anaconda-ks.cfg system-config-kickstart 2 g ...

  2. collections模块、时间模块、random模块、os模块、sys模块、序列化模块、subprocess模块

    一.collections模块 1.其他数据类型 在内置数据类型(str.dict.list.tuple.set)的基础上,collections模块还提供了了几个额外的数据类型:Counter.de ...

  3. 时间同步服务器ntpd的搭建

    如果系统没有默认安装,可以手动安装,一条命令就可以搞定: yum install ntp -y 安装之后修改配置文件: vim /etc/ntp.conf #restrict 127.0.0.1 #r ...

  4. VScode Vim插件快速上手与配置

    快速安装: 打开market place,搜索vim即可安装. 基本改建与配置说明: 方向键: 用I k j l表示光标上下左右,需要编辑visual mode和normal mode { " ...

  5. PHP如何实现处理过期或者超时订单的,并还原库存

    订单是我们在日常开发中经常会遇到的一个功能,最近在做一个订单过期与超时的开发.订单过期与超时就不用我解释了吧,其实两者都是同一个问题来着,就是订单未支付的处理,我们要做的是对这些未支付的订单到了一定时 ...

  6. Python 爬取 热词并进行分类数据分析-[App制作]

    日期:2020.02.14 博客期:154 星期五 [本博客的代码如若要使用,请在下方评论区留言,之后再用(就是跟我说一声)] 所有相关跳转: a.[简单准备] b.[云图制作+数据导入] c.[拓扑 ...

  7. vue 事件总线(bus)

    1.全局引入bus Vue.prototype.$bus = new.Vue() 2.组件间传值使用(在发送事件时接收组件会实时接收到, 可以用做兄弟组件间相互传值, 但页面跳转组件间有问题 通过$e ...

  8. 吴裕雄--天生自然Numpy库学习笔记:NumPy 创建数组

    import numpy as np x = np.empty([3,2], dtype = int) print (x) import numpy as np # 默认为浮点数 x = np.zer ...

  9. SpringBoot学习笔记(三)——Springboot配置文件

    SpringBoot不像之前用spring+springMVC做项目的时候,他不需要配置大量的看上去很乱很复杂的xml配置文件.在SpringBoot中你可以通过java代码和注解配置项目,也可以通过 ...

  10. rtt学习之线程间同步与通信

    一 线程间的同步与互斥:信号量.互斥量.实践集 线程互斥是指对于临界区资源访问的排它性,如多个线程对共享内存资源的访问,生产消费型对产品的操作.临界区操作操作方法有: rt_hw_interrupt_ ...