<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/postgresql.git/src/include/executor, branch master</title>
<subtitle>git.postgresql.org: git/postgresql.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/'/>
<entry>
<title>Add back SQLValueFunction for SQL keywords</title>
<updated>2023-05-17T01:19:17+00:00</updated>
<author>
<name>Michael Paquier</name>
<email>michael@paquier.xyz</email>
</author>
<published>2023-05-17T01:19:17+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/commit/?id=d8c3106bb60e4f87be595f241e173ba3c2b7aa2c'/>
<id>d8c3106bb60e4f87be595f241e173ba3c2b7aa2c</id>
<content type='text'>
This is equivalent to a revert of f193883 and fb32748, with the addition
that the declaration of the SQLValueFunction node needs to gain a couple
of node_attr for query jumbling.  The performance impact of removing the
function call inlining is proving to be too huge for some workloads
where these are used.  A worst-case test case of involving only simple
SELECT queries with a SQL keyword is proving to lead to a reduction of
10% in TPS via pgbench and prepared queries on a high-end machine.

None of the tests I ran back for this set of changes saw such a huge
gap, but Alexander Lakhin and Andres Freund have found that this can be
noticeable.  Keeping the older performance would mean to do more
inlining in the executor when using COERCE_SQL_SYNTAX for a function
expression, similarly to what SQLValueFunction does.  This requires more
redesign work and there is little time until 16beta1 is released, so for
now reverting the change is the best way forward, bringing back the
previous performance.

Bump catalog version.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/b32bed1b-0746-9b20-1472-4bdc9ca66d52@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is equivalent to a revert of f193883 and fb32748, with the addition
that the declaration of the SQLValueFunction node needs to gain a couple
of node_attr for query jumbling.  The performance impact of removing the
function call inlining is proving to be too huge for some workloads
where these are used.  A worst-case test case of involving only simple
SELECT queries with a SQL keyword is proving to lead to a reduction of
10% in TPS via pgbench and prepared queries on a high-end machine.

None of the tests I ran back for this set of changes saw such a huge
gap, but Alexander Lakhin and Andres Freund have found that this can be
noticeable.  Keeping the older performance would mean to do more
inlining in the executor when using COERCE_SQL_SYNTAX for a function
expression, similarly to what SQLValueFunction does.  This requires more
redesign work and there is little time until 16beta1 is released, so for
now reverting the change is the best way forward, bringing back the
previous performance.

Bump catalog version.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/b32bed1b-0746-9b20-1472-4bdc9ca66d52@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Move PartitionPruneInfo out of plan nodes into PlannedStmt"</title>
<updated>2023-05-04T10:09:59+00:00</updated>
<author>
<name>Alvaro Herrera</name>
<email>alvherre@alvh.no-ip.org</email>
</author>
<published>2023-05-04T10:09:59+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/commit/?id=5472743d9e8583638a897b47558066167cc14583'/>
<id>5472743d9e8583638a897b47558066167cc14583</id>
<content type='text'>
This reverts commit ec386948948c and its fixup 589bb816499e.

This change was intended to support query planning avoiding acquisition
of locks on partitions that were going to be pruned; however, the
overall project took a different direction at [1] and this bit is no
longer needed.  Put things back the way they were as agreed in [2], to
avoid unnecessary complexity.

Discussion: [1] https://postgr.es/m/4191508.1674157166@sss.pgh.pa.us
Discussion: [2] https://postgr.es/m/20230502175409.kcoirxczpdha26wt@alvherre.pgsql
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit ec386948948c and its fixup 589bb816499e.

This change was intended to support query planning avoiding acquisition
of locks on partitions that were going to be pruned; however, the
overall project took a different direction at [1] and this bit is no
longer needed.  Put things back the way they were as agreed in [2], to
avoid unnecessary complexity.

Discussion: [1] https://postgr.es/m/4191508.1674157166@sss.pgh.pa.us
Discussion: [2] https://postgr.es/m/20230502175409.kcoirxczpdha26wt@alvherre.pgsql
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename ExecAggTransReparent, and improve its documentation.</title>
<updated>2023-04-24T17:01:33+00:00</updated>
<author>
<name>Tom Lane</name>
<email>tgl@sss.pgh.pa.us</email>
</author>
<published>2023-04-24T17:01:33+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/commit/?id=fce3b26e97ca98de054734e2af7d9125661a9b3f'/>
<id>fce3b26e97ca98de054734e2af7d9125661a9b3f</id>
<content type='text'>
The name of this function suggests that it ought to reparent R/W
expanded objects to be children of the persistent aggcontext, instead
of copying them.  In fact it does no such thing, and if you try to
make it do so you will see multiple regression failures.  Rename it
to the less-misleading ExecAggCopyTransValue, and add commentary
about why that attractive-sounding optimization won't work.  Also
adjust comments at call sites, some of which were describing logic
that has since been moved into ExecAggCopyTransValue.

Discussion: https://postgr.es/m/3004282.1681930251@sss.pgh.pa.us
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The name of this function suggests that it ought to reparent R/W
expanded objects to be children of the persistent aggcontext, instead
of copying them.  In fact it does no such thing, and if you try to
make it do so you will see multiple regression failures.  Rename it
to the less-misleading ExecAggCopyTransValue, and add commentary
about why that attractive-sounding optimization won't work.  Also
adjust comments at call sites, some of which were describing logic
that has since been moved into ExecAggCopyTransValue.

Discussion: https://postgr.es/m/3004282.1681930251@sss.pgh.pa.us
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert 11470f544e</title>
<updated>2023-04-03T13:54:31+00:00</updated>
<author>
<name>Alexander Korotkov</name>
<email>akorotkov@postgresql.org</email>
</author>
<published>2023-04-03T13:54:31+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/commit/?id=2b65bf046d8a23be25502638da77a1592da2548d'/>
<id>2b65bf046d8a23be25502638da77a1592da2548d</id>
<content type='text'>
Discussion: https://postgr.es/m/20230323003003.plgaxjqahjgkuxrk%40awork3.anarazel.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Discussion: https://postgr.es/m/20230323003003.plgaxjqahjgkuxrk%40awork3.anarazel.de
</pre>
</div>
</content>
</entry>
<entry>
<title>SQL/JSON: support the IS JSON predicate</title>
<updated>2023-03-31T20:34:04+00:00</updated>
<author>
<name>Alvaro Herrera</name>
<email>alvherre@alvh.no-ip.org</email>
</author>
<published>2023-03-31T20:34:04+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/commit/?id=6ee30209a6f161d0a267a33f090c70c579c87c00'/>
<id>6ee30209a6f161d0a267a33f090c70c579c87c00</id>
<content type='text'>
This patch introduces the SQL standard IS JSON predicate. It operates
on text and bytea values representing JSON, as well as on the json and
jsonb types. Each test has IS and IS NOT variants and supports a WITH
UNIQUE KEYS flag. The tests are:

IS JSON [VALUE]
IS JSON ARRAY
IS JSON OBJECT
IS JSON SCALAR

These should be self-explanatory.

The WITH UNIQUE KEYS flag makes these return false when duplicate keys
exist in any object within the value, not necessarily directly contained
in the outermost object.

Author: Nikita Glukhov &lt;n.gluhov@postgrespro.ru&gt;
Author: Teodor Sigaev &lt;teodor@sigaev.ru&gt;
Author: Oleg Bartunov &lt;obartunov@gmail.com&gt;
Author: Alexander Korotkov &lt;aekorotkov@gmail.com&gt;
Author: Amit Langote &lt;amitlangote09@gmail.com&gt;
Author: Andrew Dunstan &lt;andrew@dunslane.net&gt;

Reviewers have included (in no particular order) Andres Freund, Alexander
Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zihong Yu,
Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby.

Discussion: https://postgr.es/m/CAF4Au4w2x-5LTnN_bxky-mq4=WOqsGsxSpENCzHRAzSnEd8+WQ@mail.gmail.com
Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru
Discussion: https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.de
Discussion: https://postgr.es/m/abd9b83b-aa66-f230-3d6d-734817f0995d%40postgresql.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch introduces the SQL standard IS JSON predicate. It operates
on text and bytea values representing JSON, as well as on the json and
jsonb types. Each test has IS and IS NOT variants and supports a WITH
UNIQUE KEYS flag. The tests are:

IS JSON [VALUE]
IS JSON ARRAY
IS JSON OBJECT
IS JSON SCALAR

These should be self-explanatory.

The WITH UNIQUE KEYS flag makes these return false when duplicate keys
exist in any object within the value, not necessarily directly contained
in the outermost object.

Author: Nikita Glukhov &lt;n.gluhov@postgrespro.ru&gt;
Author: Teodor Sigaev &lt;teodor@sigaev.ru&gt;
Author: Oleg Bartunov &lt;obartunov@gmail.com&gt;
Author: Alexander Korotkov &lt;aekorotkov@gmail.com&gt;
Author: Amit Langote &lt;amitlangote09@gmail.com&gt;
Author: Andrew Dunstan &lt;andrew@dunslane.net&gt;

Reviewers have included (in no particular order) Andres Freund, Alexander
Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zihong Yu,
Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby.

Discussion: https://postgr.es/m/CAF4Au4w2x-5LTnN_bxky-mq4=WOqsGsxSpENCzHRAzSnEd8+WQ@mail.gmail.com
Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru
Discussion: https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.de
Discussion: https://postgr.es/m/abd9b83b-aa66-f230-3d6d-734817f0995d%40postgresql.org
</pre>
</div>
</content>
</entry>
<entry>
<title>Move ExecEvalJsonConstructor new function to a more natural place</title>
<updated>2023-03-31T10:55:25+00:00</updated>
<author>
<name>Alvaro Herrera</name>
<email>alvherre@alvh.no-ip.org</email>
</author>
<published>2023-03-31T10:55:25+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/commit/?id=9b058f6b0d9c3d1ccde4d51a72bf15ce731973a1'/>
<id>9b058f6b0d9c3d1ccde4d51a72bf15ce731973a1</id>
<content type='text'>
Commit 7081ac46ace8 put it at the end of the file, but that doesn't look
very nice.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 7081ac46ace8 put it at the end of the file, but that doesn't look
very nice.
</pre>
</div>
</content>
</entry>
<entry>
<title>Parallel Hash Full Join.</title>
<updated>2023-03-30T22:34:03+00:00</updated>
<author>
<name>Thomas Munro</name>
<email>tmunro@postgresql.org</email>
</author>
<published>2023-03-30T22:01:51+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/commit/?id=11c2d6fdf5af1aacec9ca2005543f1b0fc4cc364'/>
<id>11c2d6fdf5af1aacec9ca2005543f1b0fc4cc364</id>
<content type='text'>
Full and right outer joins were not supported in the initial
implementation of Parallel Hash Join because of deadlock hazards (see
discussion).  Therefore FULL JOIN inhibited parallelism, as the other
join strategies can't do that in parallel either.

Add a new PHJ phase PHJ_BATCH_SCAN that scans for unmatched tuples on
the inner side of one batch's hash table.  For now, sidestep the
deadlock problem by terminating parallelism there.  The last process to
arrive at that phase emits the unmatched tuples, while others detach and
are free to go and work on other batches, if there are any, but
otherwise they finish the join early.

That unfairness is considered acceptable for now, because it's better
than no parallelism at all.  The build and probe phases are run in
parallel, and the new scan-for-unmatched phase, while serial, is usually
applied to the smaller of the two relations and is either limited by
some multiple of work_mem, or it's too big and is partitioned into
batches and then the situation is improved by batch-level parallelism.

Author: Melanie Plageman &lt;melanieplageman@gmail.com&gt;
Author: Thomas Munro &lt;thomas.munro@gmail.com&gt;
Reviewed-by: Thomas Munro &lt;thomas.munro@gmail.com&gt;
Discussion: https://postgr.es/m/CA%2BhUKG%2BA6ftXPz4oe92%2Bx8Er%2BxpGZqto70-Q_ERwRaSyA%3DafNg%40mail.gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Full and right outer joins were not supported in the initial
implementation of Parallel Hash Join because of deadlock hazards (see
discussion).  Therefore FULL JOIN inhibited parallelism, as the other
join strategies can't do that in parallel either.

Add a new PHJ phase PHJ_BATCH_SCAN that scans for unmatched tuples on
the inner side of one batch's hash table.  For now, sidestep the
deadlock problem by terminating parallelism there.  The last process to
arrive at that phase emits the unmatched tuples, while others detach and
are free to go and work on other batches, if there are any, but
otherwise they finish the join early.

That unfairness is considered acceptable for now, because it's better
than no parallelism at all.  The build and probe phases are run in
parallel, and the new scan-for-unmatched phase, while serial, is usually
applied to the smaller of the two relations and is either limited by
some multiple of work_mem, or it's too big and is partitioned into
batches and then the situation is improved by batch-level parallelism.

Author: Melanie Plageman &lt;melanieplageman@gmail.com&gt;
Author: Thomas Munro &lt;thomas.munro@gmail.com&gt;
Reviewed-by: Thomas Munro &lt;thomas.munro@gmail.com&gt;
Discussion: https://postgr.es/m/CA%2BhUKG%2BA6ftXPz4oe92%2Bx8Er%2BxpGZqto70-Q_ERwRaSyA%3DafNg%40mail.gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix outdated comments regarding TupleTableSlots</title>
<updated>2023-03-30T03:37:03+00:00</updated>
<author>
<name>David Rowley</name>
<email>drowley@postgresql.org</email>
</author>
<published>2023-03-30T03:37:03+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/commit/?id=902ecd3bd4e733d273e69fd420df6fab4ffbe79b'/>
<id>902ecd3bd4e733d273e69fd420df6fab4ffbe79b</id>
<content type='text'>
The tts_flag is named TTS_FLAG_SHOULDFREE, so use that instead of
TTS_SHOULDFREE, which is the name of the macro that checks for that flag.

Additionally, 4da597edf got rid of the TupleTableSlot.tts_tuple field but
forgot to update a comment which referenced that field.  Fix that.

Reported-by: Zhen Mingyang &lt;zhenmingyang@yeah.net&gt;
Reported-by: Richard Guo &lt;guofenglinux@gmail.com&gt;
Discussion: https://postgr.es/m/1a96696c.9d3.187193989c3.Coremail.zhenmingyang@yeah.net
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The tts_flag is named TTS_FLAG_SHOULDFREE, so use that instead of
TTS_SHOULDFREE, which is the name of the macro that checks for that flag.

Additionally, 4da597edf got rid of the TupleTableSlot.tts_tuple field but
forgot to update a comment which referenced that field.  Fix that.

Reported-by: Zhen Mingyang &lt;zhenmingyang@yeah.net&gt;
Reported-by: Richard Guo &lt;guofenglinux@gmail.com&gt;
Discussion: https://postgr.es/m/1a96696c.9d3.187193989c3.Coremail.zhenmingyang@yeah.net
</pre>
</div>
</content>
</entry>
<entry>
<title>SQL/JSON: add standard JSON constructor functions</title>
<updated>2023-03-29T10:11:36+00:00</updated>
<author>
<name>Alvaro Herrera</name>
<email>alvherre@alvh.no-ip.org</email>
</author>
<published>2023-03-29T10:11:36+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/commit/?id=7081ac46ace8c459966174400b53418683c9fe5c'/>
<id>7081ac46ace8c459966174400b53418683c9fe5c</id>
<content type='text'>
This commit introduces the SQL/JSON standard-conforming constructors for
JSON types:

JSON_ARRAY()
JSON_ARRAYAGG()
JSON_OBJECT()
JSON_OBJECTAGG()

Most of the functionality was already present in PostgreSQL-specific
functions, but these include some new functionality such as the ability
to skip or include NULL values, and to allow duplicate keys or throw
error when they are found, as well as the standard specified syntax to
specify output type and format.

Author: Nikita Glukhov &lt;n.gluhov@postgrespro.ru&gt;
Author: Teodor Sigaev &lt;teodor@sigaev.ru&gt;
Author: Oleg Bartunov &lt;obartunov@gmail.com&gt;
Author: Alexander Korotkov &lt;aekorotkov@gmail.com&gt;
Author: Amit Langote &lt;amitlangote09@gmail.com&gt;

Reviewers have included (in no particular order) Andres Freund, Alexander
Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zihong Yu,
Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby.

Discussion: https://postgr.es/m/CAF4Au4w2x-5LTnN_bxky-mq4=WOqsGsxSpENCzHRAzSnEd8+WQ@mail.gmail.com
Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru
Discussion: https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.de
Discussion: https://postgr.es/m/abd9b83b-aa66-f230-3d6d-734817f0995d%40postgresql.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit introduces the SQL/JSON standard-conforming constructors for
JSON types:

JSON_ARRAY()
JSON_ARRAYAGG()
JSON_OBJECT()
JSON_OBJECTAGG()

Most of the functionality was already present in PostgreSQL-specific
functions, but these include some new functionality such as the ability
to skip or include NULL values, and to allow duplicate keys or throw
error when they are found, as well as the standard specified syntax to
specify output type and format.

Author: Nikita Glukhov &lt;n.gluhov@postgrespro.ru&gt;
Author: Teodor Sigaev &lt;teodor@sigaev.ru&gt;
Author: Oleg Bartunov &lt;obartunov@gmail.com&gt;
Author: Alexander Korotkov &lt;aekorotkov@gmail.com&gt;
Author: Amit Langote &lt;amitlangote09@gmail.com&gt;

Reviewers have included (in no particular order) Andres Freund, Alexander
Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zihong Yu,
Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby.

Discussion: https://postgr.es/m/CAF4Au4w2x-5LTnN_bxky-mq4=WOqsGsxSpENCzHRAzSnEd8+WQ@mail.gmail.com
Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru
Discussion: https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.de
Discussion: https://postgr.es/m/abd9b83b-aa66-f230-3d6d-734817f0995d%40postgresql.org
</pre>
</div>
</content>
</entry>
<entry>
<title>Invent GENERIC_PLAN option for EXPLAIN.</title>
<updated>2023-03-24T21:07:22+00:00</updated>
<author>
<name>Tom Lane</name>
<email>tgl@sss.pgh.pa.us</email>
</author>
<published>2023-03-24T21:07:14+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/postgresql.git/commit/?id=3c05284d83b230728e59a25e828992037ef77096'/>
<id>3c05284d83b230728e59a25e828992037ef77096</id>
<content type='text'>
This provides a very simple way to see the generic plan for a
parameterized query.  Without this, it's necessary to define
a prepared statement and temporarily change plan_cache_mode,
which is a bit tedious.

One thing that's a bit of a hack perhaps is that we disable
execution-time partition pruning when the GENERIC_PLAN option
is given.  That's because the pruning code may attempt to
fetch the value of one of the parameters, which would fail.

Laurenz Albe, reviewed by Julien Rouhaud, Christoph Berg,
Michel Pelletier, Jim Jones, and myself

Discussion: https://postgr.es/m/0a29b954b10b57f0d135fe12aa0909bd41883eb0.camel@cybertec.at
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This provides a very simple way to see the generic plan for a
parameterized query.  Without this, it's necessary to define
a prepared statement and temporarily change plan_cache_mode,
which is a bit tedious.

One thing that's a bit of a hack perhaps is that we disable
execution-time partition pruning when the GENERIC_PLAN option
is given.  That's because the pruning code may attempt to
fetch the value of one of the parameters, which would fail.

Laurenz Albe, reviewed by Julien Rouhaud, Christoph Berg,
Michel Pelletier, Jim Jones, and myself

Discussion: https://postgr.es/m/0a29b954b10b57f0d135fe12aa0909bd41883eb0.camel@cybertec.at
</pre>
</div>
</content>
</entry>
</feed>
