Optimize get_jsonb_path_all avoiding an iterator

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: dbb9aeda9959d8a8f463e841b69dfa04afc67a3a
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2019-09-20T22:31:32Z
Releases: 13.0
Optimize get_jsonb_path_all avoiding an iterator

Instead of creating an iterator object at each step down the JSONB
object/array, we can just just examine its object/array flags, which is
faster.  Also, use the recently introduced JsonbValueAsText instead of
open-coding the same thing, for code simplicity.

Author: Nikita Glukhov
Discussion: https://postgr.es/m/7c417f90-f95f-247e-ba63-d95e39c0ad14@postgrespro.ru

Files

PathChange+/−
src/backend/utils/adt/jsonfuncs.c modified +10 −23

Discussion