On Monday, June 9, 2014, Ian Barwick <i...@2ndquadrant.com> wrote:
> On 09/06/14 14:47, David G Johnston wrote:
>> Ian Barwick wrote
>>> The JDBC API provides the getGeneratedKeys() method as a way of
>>> primary key values without the need to explicitly specify the primary key
>>> column(s). This is a widely-used feature, however the implementation has
>>> performance drawbacks.
>>> Currently this feature is implemented in the JDBC driver by appending
>>> "RETURNING *" to the supplied statement. However this means all columns
>>> affected rows will be returned to the client, which causes significant
>>> performance problems, particularly on wide tables. To mitigate this, it
>>> be desirable to enable the JDBC driver to request only the primary key
ISTM that having a non-null returning clause variable when no returning is
present in the command makes things more complicated and introduces
unnecessary checks in the not uncommon case of multiple
non-returning commands being issued in series.
returningList was able to be null and so should returningClause. Then if
non-null first check for the easy column listing and then check for the
more expensive PK lookup request.
Then again the extra returning checks may just amount noise.