Re: [PATCH] Generic type subscription

Artur Zakirov <a.zakirov@postgrespro.ru>

From: Artur Zakirov <a.zakirov@postgrespro.ru>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Artur Zakirov <a.zakirov@postgrespro.ru>, Victor Wagner <vitus@wagner.pp.ru>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2016-11-03T19:57:51Z
Lists: pgsql-hackers
Hello,

Do you have an updated version of the patch?

2016-10-18 20:41 GMT+03:00 Dmitry Dolgov <9erthalion6@gmail.com>:
>
>
> > The term "subscription" is confusing me
>
> Yes, you're right. "container" is too general I think, so I renamed
> everything
> to "subscripting".
>

There is another occurrences of "subscription" including file names. Please
fix them.

Also I've sent a personal email, that we have performance degradation of
SELECT queries:

create table test (
    a int2[],
    b int4[][][]);

With patch:

=> insert into test (a[1:5], b[1:1][1:2][1:2])
      select '{1,2,3,4,5}', '{{{0,0},{1,2}}}'
      from generate_series(1,100000);
Time: 936,285 ms

=> UPDATE test SET a[0] = '2';
Time: 1605,406 ms (00:01,605)

=> UPDATE test SET b[1:1][1:1][1:2] = '{113, 117}';
Time: 1603,076 ms (00:01,603)

=> explain analyze select a[1], b[1][1][1] from test;
                                                 QUERY PLAN

------------------------------------------------------------
-------------------------------------------------
 Seq Scan on test  (cost=0.00..3858.00 rows=100000 width=6) (actual
time=0.035..241.280 rows=100000 loops=1)
 Planning time: 0.087 ms
 Execution time: 246.916 ms
(3 rows)

And without patch:

=> insert into test (a[1:5], b[1:1][1:2][1:2])
      select '{1,2,3,4,5}', '{{{0,0},{1,2}}}'
      from generate_series(1,100000);
Time: 971,677 ms

=> UPDATE test SET a[0] = '2';
Time: 1508,262 ms (00:01,508)

=> UPDATE test SET b[1:1][1:1][1:2] = '{113, 117}';
Time: 1473,459 ms (00:01,473)

=> explain analyze select a[1], b[1][1][1] from test;
                                                 QUERY PLAN

------------------------------------------------------------
------------------------------------------------
 Seq Scan on test  (cost=0.00..5286.00 rows=100000 width=6) (actual
time=0.024..98.475 rows=100000 loops=1)
 Planning time: 0.081 ms
 Execution time: 105.055 ms
(3 rows)

-- 
Artur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

Commits

  1. Throw error when assigning jsonb scalar instead of a composite object

  2. Filling array gaps during jsonb subscripting

  3. Implementation of subscripting for jsonb

  4. Support subscripting of arbitrary types, not only arrays.

  5. Remove obsoleted code relating to targetlist SRF evaluation.

  6. Include <sys/select.h> where needed