Re: [PATCH] Generic type subscription
Dmitry Dolgov <9erthalion6@gmail.com>
From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Artur Zakirov <a.zakirov@postgrespro.ru>
Cc: Victor Wagner <vitus@wagner.pp.ru>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2016-11-13T17:52:00Z
Lists: pgsql-hackers
Attachments
- generic_type_subscription_v4.patch (text/x-patch) patch v4
Hi
Sorry for late reply and thank you for the feedback (especially about the
problem with performance).
> There is another occurrences of "subscription" including file names
Fixed.
> we have performance degradation of SELECT queries
Yes, I figured it out. The main problem was about type info lookups, some of
them were made for each data extraction operation, which is unnecessary.
Here are results on my machine:
with the fixed version of patch
=# 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.950..48.370 rows=100000 loops=1)
Planning time: 0.054 ms
Execution time: 51.859 ms
(3 rows)
and without the patch
=# 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=3.443..43.452 rows=100000 loops=1)
Planning time: 0.117 ms
Execution time: 46.875 ms
(3 rows)
It's still slightly slower because of all new logic aroung subscripting
operation, but not that much.
Commits
-
Throw error when assigning jsonb scalar instead of a composite object
- aa6e46daf530 14.0 landed
-
Filling array gaps during jsonb subscripting
- 81fcc72e6622 14.0 landed
-
Implementation of subscripting for jsonb
- 676887a3b0b8 14.0 landed
-
Support subscripting of arbitrary types, not only arrays.
- c7aba7c14efd 14.0 landed
-
Remove obsoleted code relating to targetlist SRF evaluation.
- ea15e18677fc 10.0 cited
-
Include <sys/select.h> where needed
- 51c3e9fade76 10.0 cited