pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes
Date: Tue, 23 Dec 2014 10:18:02 -0500
Message-ID: <31247.1419347882@sss.pgh.pa.us> (raw)
In-Reply-To: <E1Y3PQG-0006Hc-Ff@gemulon.postgresql.org>
References: <E1Y3PQG-0006Hc-Ff@gemulon.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Use a bitmask to represent role attributes
> The previous representation using a boolean column for each attribute
> would not scale as well as we want to add further attributes.

> Extra auxilliary functions are added to go along with this change, to
> make up for the lost convenience of access of the old representation.

I have to apologize for not having paid more attention, but ... is this
*really* such a great idea?  You've just broken any client-side code
that looks directly at pg_authid.  Moreover, I don't particularly buy
the idea that this somehow insulates us from the compatibility costs of
adding new role properties: you're still going to have to add columns to
the pg_roles view, and adjust clients that look at that, every time.
Replacing bool-column accesses with bitmask manipulation doesn't seem
like it's a win on a micro-optimization level either, certainly not for
SQL-level coding where you've probably made it two orders of magnitude
more expensive.  And lastly, what happens when you run out of bits in
that bigint column?

Again, I suppose I should have objected earlier, but I really seriously
doubt that this is a good idea.

			regards, tom lane


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



view thread (27+ messages)  latest in thread

Message-ID: <31247.1419347882@sss.pgh.pa.us>
Permalink:  ../31247.1419347882@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31247.1419347882@sss.pgh.pa.us

 · 

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, alvherre@alvh.no-ip.org, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes
  In-Reply-To: <31247.1419347882@sss.pgh.pa.us>
  References: <E1Y3PQG-0006Hc-Ff@gemulon.postgresql.org> <31247.1419347882@sss.pgh.pa.us>

* 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