SQL Server表分区的NULL值问题
作者:网络转载 发布时间:[ 2015/7/23 9:48:04 ] 推荐标签:数据库
插入测试数据
USE [sss]
CREATE TABLE TinyBlog(id INT NULL,NAME VARCHAR(100))
ON [Sch_TinyBlog_Id](id)
SELECT * FROM TinyBlog ORDER BY id
INSERT INTO [dbo].[TinyBlog]
( [id], [NAME] )
VALUES ( NULL, -- id - int
'3232' -- NAME - varchar(100)
)
INSERT INTO [dbo].[TinyBlog]
( [id], [NAME] )
VALUES ( -2, -- id - int
'-2' -- NAME - varchar(100)
)
INSERT INTO [dbo].[TinyBlog]
( [id], [NAME] )
VALUES ( 66, -- id - int
'66' -- NAME - varchar(100)
)
INSERT INTO [dbo].[TinyBlog]
( [id], [NAME] )
VALUES ( 0, -- id - int
'0' -- NAME - varchar(100)
)
INSERT INTO [dbo].[TinyBlog]
( [id], [NAME] )
VALUES ( -30, -- id - int
'-30' -- NAME - varchar(100)
)
表数据如下
SELECT * FROM TinyBlog ORDER BY id
分区分布
--查看分区架构文件组分布
SELECT CONVERT(VARCHAR(MAX), ps.name) AS partition_scheme ,
p.partition_number ,
CONVERT(VARCHAR(MAX), ds2.name) AS filegroup ,
CONVERT(VARCHAR(MAX), ISNULL(v.value, ''), 120) AS range_boundary ,
STR(p.rows, 9) AS rows
FROM sys.indexes i
JOIN sys.partition_schemes ps ON i.data_space_id = ps.data_space_id
JOIN sys.destination_data_spaces dds ON ps.data_space_id = dds.partition_scheme_id
JOIN sys.data_spaces ds2 ON dds.data_space_id = ds2.data_space_id
JOIN sys.partitions p ON dds.destination_id = p.partition_number
AND p.object_id = i.object_id
AND p.index_id = i.index_id
JOIN sys.partition_functions pf ON ps.function_id = pf.function_id
LEFT JOIN sys.Partition_Range_values v ON pf.function_id = v.function_id
AND v.boundary_id = p.partition_number
- pf.boundary_value_on_right
WHERE i.object_id = OBJECT_ID('TinyBlog')
AND i.index_id IN ( 0, 1 )
ORDER BY p.partition_number
--分区区间
--SELECT * FROM sys.partition_range_values
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11