patternsqlMinor
Postgresql - Internal Array handling - array type or pointer type
Viewed 0 times
postgresqlhandlingarraytypepointerinternal
Problem
I have a question, about the internal handling of array columns in Postgres.
Does the engine handle it as a classical array with memory alloc or is it somehow a pointer list.
It would be interesting to know - I have a few questions to answer myself concerning performance... :)
Does the engine handle it as a classical array with memory alloc or is it somehow a pointer list.
It would be interesting to know - I have a few questions to answer myself concerning performance... :)
Solution
Arrays are defined in
An array is a
src/includes/utils/array.h and src/backend/utils/adt/arrayfuncs.c and the other array* files in src/backend/utils/adt/.An array is a
VARLENA (see src/backend/utils/adt/varlena.c) which is a palloc()'d type, a scoped-storage wrapper around malloc(). Arrays are block-allocated data, not linked lists.Context
StackExchange Database Administrators Q#28443, answer score: 7
Revisions (0)
No revisions yet.