postgresql/src/backend/lib
Andres Freund 70c2d1be2b Allow to avoid NUL-byte management for stringinfos and use in format.c.
In a lot of the places having appendBinaryStringInfo() maintain a
trailing NUL byte wasn't actually meaningful, e.g. when appending an
integer which can contain 0 in one of its bytes.

Removing this yields some small speedup, but more importantly will be
more consistent when providing faster variants of pq_sendint etc.

Author: Andres Freund
Discussion: https://postgr.es/m/20170914063418.sckdzgjfrsbekae4@alap3.anarazel.de
2017-10-11 16:01:52 -07: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 Fix uninitialized variable in dshash.c. 2017-09-18 17:43:37 -07: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 Allow to avoid NUL-byte management for stringinfos and use in format.c. 2017-10-11 16:01:52 -07: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.