Re: [PATCH] remove redundant ownership checks - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [PATCH] remove redundant ownership checks
Date
Msg-id 201001120127.o0C1RDd17104@momjian.us
Whole thread Raw
In response to Re: [PATCH] remove redundant ownership checks  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [PATCH] remove redundant ownership checks  (KaiGai Kohei <kaigai@ak.jp.nec.com>)
Re: [PATCH] remove redundant ownership checks  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas wrote:
> On Sun, Jan 10, 2010 at 4:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Robert Haas <robertmhaas@gmail.com> writes:
> >> I have looked this over a little bit and I guess I don't see why the
> >> lack of a grand plan for how to organize all of our permissions checks
> >> ought to keep us from removing this one on the grounds of redundancy.
> >> We have to attack this problem in small pieces if we're going to make
> >> any progress, and the pieces aren't going to get any smaller than
> >> this.
> >
> > I would turn that argument around: given the lack of a grand plan,
> > why should we remove this particular check at all?  Nobody has argued
> > that there would be a significant, or even measurable, performance gain.
> > When and if we do have a plan, we might find ourselves putting this
> > check back.
> 
> You're arguing against a straw man - there's clearly no argument here
> from performance.  We generally do not choose to litter the code with
> redundant or irrelevant checks because it makes the code difficult to
> maintain and understand.  Sometimes it also hurts performance, but
> that's not a necessary criterion for removal.  Nor are we generally in
> the habit of keeping redundant code around because a hypothetical
> future refactoring might by chance end up putting exactly the same
> code back.

I agree.  Why are arbitrary restrictions being placed on code
improvements?  If code has no purpose, why not remove it, or at least
mark it as NOT_USED.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [COMMITTERS] pgsql: Also update ChangerLog file.
Next
From: Robert Treat
Date:
Subject: 8.5alpha3 bug in information_schema.table_privileges