pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add fastpaths for when no objects are found
Date: Wed, 02 Oct 2024 11:27:43 +0000
Message-ID: <E1svxWB-001qYT-4N@gemulon.postgresql.org> (raw)

Add fastpaths for when no objects are found

If there are no objects found, there is no reason to inspect the
result columns and mallocing a zero-sized  (which will be 1 byte
in reality) heap buffer for it.  Add a fast-path for immediately
returning like how other object inspection functions are already
doing it.

Reviewed-by: Ranier Vilela <ranier.vf@gmail.com>
Discussion: https://postgr.es/m/C2F05B3C-1414-45DD-AE09-6FEE4D0F89BD@yesql.se

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9c733951049bf3993c886d7f2c7459e7439a9793

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)



Message-ID: <E1svxWB-001qYT-4N@gemulon.postgresql.org>
Permalink:  ../E1svxWB-001qYT-4N@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1svxWB-001qYT-4N@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add fastpaths for when no objects are found
  In-Reply-To: <E1svxWB-001qYT-4N@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox