Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3SDw-0006HU-TT for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Dec 2014 16:22:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y3SDw-00032k-Ab for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Dec 2014 16:22:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y3SDv-00032e-16 for pgsql-hackers@postgresql.org; Tue, 23 Dec 2014 16:22:15 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3SDr-0001cH-Qr for pgsql-hackers@postgresql.org; Tue, 23 Dec 2014 16:22:14 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 08C3E5FC44; Tue, 23 Dec 2014 11:22:09 -0500 (EST) Date: Tue, 23 Dec 2014 11:22:09 -0500 From: Stephen Frost To: Tom Lane Cc: Alvaro Herrera , pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Use a bitmask to represent role attributes Message-ID: <20141223162209.GH3062@tamriel.snowman.net> References: <31247.1419347882@sss.pgh.pa.us> <20141223152630.GM1768@alvh.no-ip.org> <31639.1419349001@sss.pgh.pa.us> <20141223155500.GE3062@tamriel.snowman.net> <32297.1419350852@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W8NyRpvKkamwD9y8" Content-Disposition: inline In-Reply-To: <32297.1419350852@sss.pgh.pa.us> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-40-generic (x86_64) X-Uptime: 11:17:09 up 3 days, 19:57, 4 users, load average: 0.16, 0.19, 0.22 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --W8NyRpvKkamwD9y8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > * Tom Lane (tgl@sss.pgh.pa.us) wrote: > >> I'd have gone with just adding more bool columns as needed. >=20 > > I don't think I was the only one concerned that adding a bunch of new > > columns would bloat the size of pg_authid and the C structure behind it, > > but I'm not remembering offhand who else considered it. >=20 > Lessee, as of 9.4 pg_authid required 76 bytes per row, plus row header > overhead that'd have probably pushed it to 104 bytes per row (more if > you had non-null rolpassword or rolvaliduntil). If we add as many as 20 > more booleans we'd be at 124 bytes per row, whereas with this approach > we'd have, well, 104 bytes per row. I'm not seeing much benefit to > justify such a drastic change of approach. I suppose. I didn't consider it to be a terribly drastic change but rather simply using a better representation for a mostly-internal bit of data. It also lended itself pretty nicely to maniuplation (at least, imv, the code is a lot cleaner with the bitmask, but it's not a huge deal). Guess I had been expecting concerns to be raised around adding many more bytes where there wouldn't have been. Thanks, Stephen --W8NyRpvKkamwD9y8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUmZaxAAoJEO1sijiDR2RVImwQAJ6WLFWJBX+DeENTMI8l71px nIzTxuZ34yNLvAcYxgtGL3mVr7wfRYPFV7ulrxKEBS7MSLKMatZXnG7UyzORt+so sGva0h0pbT2/jt8tzc/CNam9m22utDoYfSR+umWqa4yxHOxLpkky9aeFpRTPm62X thsGlsq+waJneKDNnqTr69wgMjmMIHVBBD7Oj6GAxqvN7ER8c95wH2DiQmFbodWP T6ygsrB1FeAciO9i2x37Ub1AfRv/xzpAEBBHSwhyCBNS3JHXrmazil6+flCxqL/1 9BuQuDwpEVxfTylpM1Mk99UOzPGHHTEuLsp+AwrchXTL7wP3/sKT58Vp/tQfo/N4 fwKKIHdZb47/lVjRdpmg1Yp4jM5bbrxEdLGmMQ64qW/0GRMgxds1tCPqmsrjgwqi B8dC3tyDA+5+FqST+yVnzOMbCmuYpaPzppGjsmiKOj6lDZUgLWXFxEX4KJUVjWYZ ORgCjvNHu7Lsno9AUsOEsA5YT4Ajkmp2O6SS/6kke7h/uw3us9iM3AWAOkuIW5VV ByZyk/BfZVTJ7cdC9aZ0SaEhnalWAmePojT0HMdiG1JiWImIMh0KkTsAKRqQtq5j abw65hKfCpSKSt0FCgOWOU5KQXfsSXATQSZKskgi/vuG3O67ae9w/h8VgMzr3kzq C41FOD8qATSISIylN/fZ =5xrP -----END PGP SIGNATURE----- --W8NyRpvKkamwD9y8--