hobt_id 和 partition_ID 理解
2015-12-03 14:43
531 查看
查找一些资料,总结:这两个字段的值是相同的。
1,HOBT_ID refers to Heap or B-Tree ID. As you know, data in tables is stored as HEAP or a B-Tree (Balanced tree); If there is a clustered index on the table, it is stored as a B-Tree, if not it’s a HEAP. Either way, they are stored in data pages that are all put together and referred to as one logical location. This logical location of data pages (or index pages) are referred using an ID called hobt_id. In essence, its just an ID used to refer to that logical storage.
When a table is partitioned, each partition will get a partition_ID and HOBT_ID, but when a table is not partition, it still has partition ID and HOBT_ID as it is referred to as a single partition table.
2,There is 2 columns in sys.partitions view - partition_id and hobt_id. From my point of view/experience for any given row from this view partition_id always equal hobt_id and I never see the 2 different values. It's seems reasonable, because (simplifying complex thing) we can say: "partition is hobt, hobt is partition". But at the same time article about another view - sys.allocation_units tell us:
If type = 1 or 3, container_id = sys.partitions.hobt_id.
If type is 2, then container_id = sys.partitions.partition_id.
So - these 2 values can ever be NOT equal?? As I said I had never see this in practical. Can you please give the example of table (and DB, if it needs), for which partition_id and hobt_id will be NOT equal?
They're the same thing. They were added as separate columns to support a feature that was planned, partially added to SQL 2005 and later scrapped.
3, HOBT is short for a Heap Or B-Tree. In SQL Server, a table without a clustered index is called a heap. A table with a clustered index is called….a table with a clustered index.Table With A Clustered Index isn’t very cool sounding. Fortunately for us, clustered indexes are implemented in SQL Server as B-Trees .
Now technically, a HOBT isn’t always representative of the entire Heap Or B-Tree. It’s actually the subset of a table that lies on a given partition. So if you have a table split across five partitions, you have five HOBT’s in the table.
You’ll see HOBTs referenced throughout SQL Server documentation and literature, and within SQL Server itself. For example, the hobt_id in sys.partitions is a direct reference to the same HOBT we’re discussing here. You’ll notice that the hobt_id is the same as the partition_id if you query sys.partitions. There is currently a 1:1 relationship between HOBTs and partitions, although the fact that they’re tracked out as separate identifiers might lead one to believe that this could very well change in the future.
1,HOBT_ID refers to Heap or B-Tree ID. As you know, data in tables is stored as HEAP or a B-Tree (Balanced tree); If there is a clustered index on the table, it is stored as a B-Tree, if not it’s a HEAP. Either way, they are stored in data pages that are all put together and referred to as one logical location. This logical location of data pages (or index pages) are referred using an ID called hobt_id. In essence, its just an ID used to refer to that logical storage.
When a table is partitioned, each partition will get a partition_ID and HOBT_ID, but when a table is not partition, it still has partition ID and HOBT_ID as it is referred to as a single partition table.
2,There is 2 columns in sys.partitions view - partition_id and hobt_id. From my point of view/experience for any given row from this view partition_id always equal hobt_id and I never see the 2 different values. It's seems reasonable, because (simplifying complex thing) we can say: "partition is hobt, hobt is partition". But at the same time article about another view - sys.allocation_units tell us:
If type = 1 or 3, container_id = sys.partitions.hobt_id.
If type is 2, then container_id = sys.partitions.partition_id.
So - these 2 values can ever be NOT equal?? As I said I had never see this in practical. Can you please give the example of table (and DB, if it needs), for which partition_id and hobt_id will be NOT equal?
They're the same thing. They were added as separate columns to support a feature that was planned, partially added to SQL 2005 and later scrapped.
3, HOBT is short for a Heap Or B-Tree. In SQL Server, a table without a clustered index is called a heap. A table with a clustered index is called….a table with a clustered index.Table With A Clustered Index isn’t very cool sounding. Fortunately for us, clustered indexes are implemented in SQL Server as B-Trees .
Now technically, a HOBT isn’t always representative of the entire Heap Or B-Tree. It’s actually the subset of a table that lies on a given partition. So if you have a table split across five partitions, you have five HOBT’s in the table.
You’ll see HOBTs referenced throughout SQL Server documentation and literature, and within SQL Server itself. For example, the hobt_id in sys.partitions is a direct reference to the same HOBT we’re discussing here. You’ll notice that the hobt_id is the same as the partition_id if you query sys.partitions. There is currently a 1:1 relationship between HOBTs and partitions, although the fact that they’re tracked out as separate identifiers might lead one to believe that this could very well change in the future.
相关文章推荐
- 【转】android新组件RecyclerView使用介绍和进阶使用,替用Gallery
- [推荐] - 业余网站
- ORA-12514:TNS:listener does not currently know of service requested in connect descriptor
- JMeter学习(四)参数化
- acm 2037 水题一个 注意细节- - 然后 没有然后了
- 用jconsole可视化JVM的运行状态
- 【Android实战】RecyclerView实现水平可滚动gridview
- unity3d利用sharesdk分享内容至微信、新浪微博、qq空间等国内主流社交平台(ios篇)
- 微信应用放在tomcat上正常,放到weblogic上回调失败
- socket通信
- Android GC 那点事
- Android PullToRefresh (ListView GridView 下拉刷新) 使用详解
- java实现base64字符串转换png图片
- light oj 1008 - Fibsieve`s Fantabulous Birthday
- [Android实例] Handler+ExecutorService(线程池)+MessageQueue模式+缓存模式
- 练手小程序(五)
- maven入门学习
- JAVA继承引入
- 收集整理:三极管与mos管
- Android设置Settings实现:PreferenceActivity