Improve the efficiency of certain jsonb get operations.

Andrew Dunstan <andrew@dunslane.net>

Commit: 1a4174a498a15a848d4c4c50a3a9ef500926e4bd
Author: Andrew Dunstan <andrew@dunslane.net>
Date: 2014-06-01T23:04:02Z
Releases: 9.4.0
Improve the efficiency of certain jsonb get operations.

Instead of iterating over jsonb structures, use the inbuilt functions
findJsonbValueFromContainerLen() and getIthJsonbValueFromContainer() to
extract values directly. These functions use algorithms that are O(n log
n) and O(1) respectively, whereas iterating is O(n), so we should see
considerable speedup here.

Teodor Sigaev.

Files

PathChange+/−
src/backend/utils/adt/jsonfuncs.c modified +64 −112