Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eetkf-00088m-QY for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2018 02:28:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eetke-0006NI-IX for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2018 02:28:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eetke-0006N8-Be for pgsql-hackers@lists.postgresql.org; Fri, 26 Jan 2018 02:28:24 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eetkV-0000PF-Tg for pgsql-hackers@postgresql.org; Fri, 26 Jan 2018 02:28:22 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 0EB055F79C; Thu, 25 Jan 2018 21:28:14 -0500 (EST) Date: Thu, 25 Jan 2018 21:28:13 -0500 From: Stephen Frost To: Craig Ringer Cc: Michael Paquier , Alvaro Herrera , Andreas Karlsson , PostgreSQL mailing lists Subject: Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Message-ID: <20180126022813.GD2416@tamriel.snowman.net> References: <20171221024626.ycidqbnwcz25ekry@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4GydFQtOwKPyIFXL" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --4GydFQtOwKPyIFXL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Craig, Michael, all, * Craig Ringer (craig@2ndquadrant.com) wrote: > On 21 December 2017 at 11:31, Michael Paquier > wrote: >=20 > > On Thu, Dec 21, 2017 at 11:46 AM, Alvaro Herrera > > wrote: > > > Michael Paquier wrote: > > >> Well, the idea is really to get rid of that as there are already > > >> facilities of this kind for CREATE TABLE LIKE in the parser and ALTER > > >> TABLE when rewriting a relation. It is not really attractive to have= a > > >> 3rd method in the backend code to do the same kind of things, for a > > >> method that is even harder to maintain than the other two. > > > > > > I dislike the backend code that uses SPI and manufacturing node to > > > re-creates indexes. IMO we should get rid of it. Let's not call it > > > "facilities", but rather "grotty hacks". > > > > Aha. You are making my day here ;) > > > > > I think before suggesting to add even more code to perpetuate that id= ea, > > > we should think about going in the other direction. I have not tried= to > > > write the code, but it should be possible to have an intermediate > > > function called by ProcessUtility* which transforms the IndexStmt into > > > an internal representation, then calls DefineIndex. This way, all t= his > > > code that wants to create indexes for backend-internal reasons can > > > create the internal representation directly then call DefineIndex, > > > instead of the horrible hacks they use today creating parse nodes by > > > hand. > > > > Yeah, that would be likely possible. I am not volunteering for that in > > the short term though.. >=20 > It sounds like that'd make some of ALTER TABLE a bit less ... upsetting .= =2E. > too. I'm a big fan of this patch but it doesn't appear to have made any progress in quite a while. Is there any chance we can get an updated patch and perhaps get another review before the end of this CF...? Refactoring this to have an internal representation between ProcessUtility() and DefineIndex doesn't sound too terrible and if it means the ability to reuse that, seems like it'd be awful nice to do so.. Thanks! Stephen --4GydFQtOwKPyIFXL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJaapI9AAoJEO1sijiDR2RVOQEP/jB1lwVeKk7lyrhDitmuCJnp pU+LcZ/aUgcIbLdWaYOQWaZxzMw7ACAsY9p3mbFTKenMRMgpb9BuY5EqhK+7OKFZ LmeN0i02GibGIQDTH0Q7kQX3+Q5HzVUoaBG7RYA0L6O0/yt/UiydfnOhxVIOs1pO VvMHZohFwwbN+L8yJ1NIpuEjBejiTH1XRZ1RbSEjrIj+jX5EmcQ4fErM34moG9bL KU1X4GwLlU/HwqWk/25U2DRQoZHVuYTGX5phn3C3Zj/Ile5e1MhVEpG5HX9r7RBp 9KrjzdHmwDpLtvWf1h0TIptVbV4WES4bY6zE/T19nDToI26iNYQtsZOlFcJbQAMs sEi4uau3JQtrezany3nVtoTNizOA8MAwDectUZpNrd0HoEgjyzJDDFGlyAlaqBNh BYChiFtndeexLtmIjNjUv155UW+0WLvnKLtLxoTQ+YLirE/34LYykH+ndDD0y95n WouB/lRI2t+30HjJKp2FcGDW+u2pjma0Jh8zpgW+VAEgLob2THlgBCr5LFxxscho snz5FIxqv3BzhDZtPAbeUW5oyuhhNh6wofxxHmhTXnw0mX1r+eO8ow/SEJ2k4GQR 2UV7V/rhn+6gJexU2qGg6WcMnlT8GP6WRVW3qe+k4Dirld/zobeaeE/y7zpX8Ivb aBhlxrBNqyPy0u5+mF6w =nhTp -----END PGP SIGNATURE----- --4GydFQtOwKPyIFXL--