HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

Are heaps considered an index structure or are they strictly a table structure without index?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
withoutstrictlyareconsideredstructureindexheapstheytable

Problem

Inspired by this post: https://twitter.com/#!/SQLChicken/status/102930436795285505

Heaps: Are they considered an index structure or are they strictly a table structure without index?

Solution

An index implies there is data order to the rows. Given that a heap isn't created with any such order and doesn't maintain an order either, it's just a method of storing table data.

There are a few examples (say, dm_db_index_physical_stats) where to specify a heap, you have to enter an index id of 0. While this seems to contradict what I just said, I think this is just a magic value to simplify the API and its usage; nothing more.

Context

StackExchange Database Administrators Q#4630, answer score: 10

Revisions (0)

No revisions yet.