postgresql/src/backend/lib
Tom Lane f80e782a6b Remove pre-order and post-order traversal logic for red-black trees.
This code isn't used, and there's no clear reason why anybody would ever
want to use it.  These traversal mechanisms don't yield a visitation order
that is semantically meaningful for any external purpose, nor are they
any faster or simpler than the left-to-right or right-to-left traversals.
(In fact, some rough testing suggests they are slower :-(.)  Moreover,
these mechanisms are impossible to test in any arm's-length fashion; doing
so requires knowledge of the red-black tree's internal implementation.
Hence, let's just jettison them.

Discussion: https://postgr.es/m/17735.1505003111@sss.pgh.pa.us
2017-09-10 13:19:11 -04:00
..
Makefile Hash tables backed by DSA shared memory. 2017-08-22 22:43:07 -07:00
README Fix typos, update README. 2015-01-23 15:06:53 -05:00
binaryheap.c Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00
bipartite_match.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
dshash.c Suppress compiler warnings in dshash.c. 2017-09-03 11:12:29 -04:00
hyperloglog.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
ilist.c Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
knapsack.c Support hashed aggregation with grouping sets. 2017-03-27 04:20:54 +01:00
pairingheap.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
rbtree.c Remove pre-order and post-order traversal logic for red-black trees. 2017-09-10 13:19:11 -04:00
stringinfo.c Revert "Permit dump/reload of not-too-large >1GB tuples" 2017-05-10 18:41:27 -03:00

README

This directory contains a general purpose data structures, for use anywhere
in the backend:

binaryheap.c - a binary heap

hyperloglog.c - a streaming cardinality estimator

pairingheap.c - a pairing heap

rbtree.c - a red-black tree

ilist.c - single and double-linked lists.

stringinfo.c - an extensible string type


Aside from the inherent characteristics of the data structures, there are a
few practical differences between the binary heap and the pairing heap. The
binary heap is fully allocated at creation, and cannot be expanded beyond the
allocated size. The pairing heap on the other hand has no inherent maximum
size, but the caller needs to allocate each element being stored in the heap,
while the binary heap works with plain Datums or pointers.

The linked-lists in ilist.c can be embedded directly into other structs, as
opposed to the List interface in nodes/pg_list.h.