Re: jsonb access operators inefficiency

From: Oleg Bartunov <obartunov(at)gmail(dot)com>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb access operators inefficiency
Date: 2014-05-30 17:30:05
Message-ID: CAF4Au4xsQNASJU6LkohQWv55EyBYNi0LEX0kZm3QEkVBdmy_mw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The patch really improves access performance to jsonb. On the
delicious bookmarks I got 5 times better performance.Now jsonb
outperforms json on simple access (slide 12 of pgcon presentation) by
103 times !

Oleg

On Fri, May 30, 2014 at 9:35 AM, Teodor Sigaev <teodor(at)sigaev(dot)ru> wrote:
> Hi!
>
> jsonb operators ->text, ->>text,->int, ->>int use inefficient methods to
> access to needed field, proportional O(N/2). Attached patch suggests for
> text operators O(log(N)) and for integer - O(1). The fuctions with fast
> access already are existed in current code and are used in contains
> operation, for example. Attached patch uses that functions instead of
> sequentual loop over object/array.
> --
> Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
> WWW:
> http://www.sigaev.ru/
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2014-05-30 17:39:17 Re: jsonb access operators inefficiency
Previous Message Asif Naeem 2014-05-30 17:25:54 Re: unable to build postgres-9.4 in os x 10.9 with python