]> granicus.if.org Git - postgresql/commit
Improve the efficiency of certain jsonb get operations.
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 1 Jun 2014 23:04:02 +0000 (19:04 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 1 Jun 2014 23:04:02 +0000 (19:04 -0400)
commit1a4174a498a15a848d4c4c50a3a9ef500926e4bd
tree10a829976e711a0c26c45ebf543f3984382cfd3a
parenta57509821c3147b2bf57560e3bce1641d78a7519
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.
src/backend/utils/adt/jsonfuncs.c