Understanding Heap-Organized Tables and Heap Data Structure

terminology

AFAIK, heap-organized tables, which are default in Oracle and PostgreSQL, are just tables without any clustered index.

I'm wondering where the term 'heap' got its name. It's just a pile of data, not related to 'Heap' the data structure, right? Just another confusing name that made me search everywhere why databases use 'Heap'.

Is it from 'Heap' the pool of memory above stack? Or is there any historical / academical backgrounds?

Best Answer

In computing generally a "heap" is just a general dumping ground, available for allocation then a block of memory/disk is needed. See https://en.wikipedia.org/wiki/Memory_management#HEAP for a lot more detail.

The data structure called a heap can be used to manage the allocation of space, or to operate as a priority queue, amongst other more minor uses. See https://en.wikipedia.org/wiki/Heap_(data_structure)

In a database, and more generally, a storage heap may be managed by a head-based data structure, though that does not have to be the case: the names being the same does not imply that they are in any way mutually inclusive.