Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am currently doing some data imports into a legacy system and discovered that this system does not use a single clustered index. A quick Google search introduced me to the concept of HEAP tables and now I am curious in what usage scenarios a HEAP table should be preferred over a clustered table?

As far as I understood a HEAP table would only be useful for audit tables and/or where inserts happen far more often than selects. It would save disk space and disk I/O since there is no clustered index to maintain and the additional fragmentation wouldn’t be a problem because of the very rare reads.

share|improve this question
1  
Are you talking about SQL Server? – a_horse_with_no_name Nov 8 '12 at 12:57
@a_horse_with_no_name yes, i forgot to mention that sry – marc.d Nov 8 '12 at 16:10

1 Answer

up vote 8 down vote accepted

The only valid use is for staging tables used in import/export/ETL processes.

These table are typically quite flat and truncated before/after use.

Note that a clustered index is typically few small compared to the data size: the data is the lowest level of the index structure.

Heap tables also have problems. At least these:

Also see

share|improve this answer
2  
It typically use heaps for two separate things. ETL staging and work tables that I use to temporarily store data when the set is to large for a temp table to work effectively. All of which are truncated at next load. – Zane Nov 9 '12 at 17:12
Good question by the way. – Zane Nov 9 '12 at 17:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.