pgsql: Improve the efficiency of certain jsonb get operations.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve the efficiency of certain jsonb get operations.
Date: 2014-06-01 23:13:12
Message-ID: E1WrEwC-00011A-Mf@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1a4174a498a15a848d4c4c50a3a9ef500926e4bd

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c | 176 ++++++++++++++-----------------------
1 file changed, 64 insertions(+), 112 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2014-06-02 20:18:48 pgsql: doc: fix JSON function prototype variable label
Previous Message Tom Lane 2014-06-01 19:03:28 pgsql: PL/Python: Adjust the regression tests for Python 3.4