pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: #ifdef out assorted unused GEQO code.
Date: Sun, 04 Jun 2017 17:34:15 +0000
Message-ID: <E1dHZPr-0000rb-CJ@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

#ifdef out assorted unused GEQO code.

I'd always assumed that backend/optimizer/geqo/'s remarkably poor
showing on code coverage metrics was because we weren't exercising
it much in the regression tests.  But it turns out that a good chunk
of the problem is that there's a bunch of code that is physically
unreachable (because the calls to it are #ifdef'd out in geqo_main.c)
but is being built anyway.  Making the called code have #if guards
similar to the calling code saves a couple of kilobytes of executable
size and should make the coverage numbers more reflective of reality.

It's arguable that we should just delete all the unused recombination
mechanisms altogether, but I didn't feel a need to go that far today.

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/geqo/geqo_cx.c            | 3 +++
src/backend/optimizer/geqo/geqo_erx.c           | 3 +++
src/backend/optimizer/geqo/geqo_main.c          | 4 ++--
src/backend/optimizer/geqo/geqo_mutation.c      | 4 ++++
src/backend/optimizer/geqo/geqo_ox1.c           | 3 +++
src/backend/optimizer/geqo/geqo_ox2.c           | 3 +++
src/backend/optimizer/geqo/geqo_pmx.c           | 3 +++
src/backend/optimizer/geqo/geqo_px.c            | 3 +++
src/backend/optimizer/geqo/geqo_recombination.c | 5 +++++
src/include/optimizer/geqo.h                    | 2 +-
10 files changed, 30 insertions(+), 3 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1dHZPr-0000rb-CJ@gemulon.postgresql.org>
Permalink:  ../E1dHZPr-0000rb-CJ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1dHZPr-0000rb-CJ@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: #ifdef out assorted unused GEQO code.
  In-Reply-To: <E1dHZPr-0000rb-CJ@gemulon.postgresql.org>
  References: <E1dHZPr-0000rb-CJ@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