Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hv8TR-0004YR-J3 for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Aug 2019 23:02:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hv8TQ-0000bB-FH for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Aug 2019 23:02:32 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hv8TQ-0000Xt-6q for pgsql-hackers@lists.postgresql.org; Tue, 06 Aug 2019 23:02:32 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hv8TN-0001it-H0 for pgsql-hackers@lists.postgresql.org; Tue, 06 Aug 2019 23:02:31 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id E58A25F79F; Tue, 6 Aug 2019 19:02:28 -0400 (EDT) Date: Tue, 6 Aug 2019 19:02:28 -0400 From: Stephen Frost To: Tom Lane Cc: Alvaro Herrera , Pg Hackers Subject: Re: no default hash partition Message-ID: <20190806230228.GE29202@tamriel.snowman.net> References: <20190806225310.GA17708@alvherre.pgsql> <16738.1565132324@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AUQwVXcAo9lqRS7e" Content-Disposition: inline In-Reply-To: <16738.1565132324@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --AUQwVXcAo9lqRS7e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Alvaro Herrera writes: > > On 2019-Aug-06, Tom Lane wrote: > >> Seems like "it's likely to cause trouble for users" is just going to > >> beg the question "why?". Can we explain the hazard succinctly? > >> Or point to a comment somewhere else that explains it? >=20 > > Right ... the "trouble" is just that if the user later wants to add the > > missing partitions, they'll need to acquire some strong lock (IIRC it's= AEL) > > in the partitioned table, so it effectively means an outage. With > > list/range partitioning, there's the slight advantage that you don't > > have to guess all your partitions in advance, or cover data values that > > are required for a very small number of rows. In hash partitioning you > > can't really predict which values are those going to be, and the set of > > missing partitions is perfectly known. >=20 > Hmm. So given the point about it being hard to predict which hash > partitions would receive what values ... under what circumstances > would it be sensible to not create a full set of partitions? Should > we just enforce that there is a full set, somehow? I imagine there's good reasons this wasn't just done (for this or various other things), but couldn't we enforce it by just creating them all..? Sure would simplify a lot of things for users. Similairly for list partitions, I would think. Again, I feel like there's probably a reason why it doesn't just work(tm) like that, but it sure would be nice. Of course, there's the other side of things where it'd sure be nice to automatically have partitions created for time-based partitions when appropriate (yes, basically doing what pg_partman already does, but in core somehow..), but for hash partitions we don't need to deal with that. Thanks, Stephen --AUQwVXcAo9lqRS7e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJdSgcEAAoJEO1sijiDR2RVvxkQAKoxOhbFaWupFvG7+JB8SunN v2jas5Jr1N3aoAafB+7C4+9KmbyvCb1iJQUTMhOMUC8g+rR+ckxiy92FtX5h6MhY QKE/ib9RTtEFWMx8XwivYPacl29lgHjWtnbxjh+LFBSUf2szNoqT09mb7WTydLtD CkJNdEIf32wGTEAqA2GjAvPvio/OgtFztZKU9DTpK1/Aat496Vg2j9aRxrEB6Mt/ anplD4P2l/ETLPe4vU51XiQ9DWmNOP3+UqOo3WAJoBHd83/pKg2A5lrVfU16339/ 5oVYtTJ3vMAf4cwTt/fVxF0++JiP8y/nQeUzvhf5j/4Dpgf4Vs0EAdC8vIcwjiBi Icjk6S/tHUqmAoqQO6llMt3nD5UWxz/rEw7iLUnmc39lhwxDLoXaH+n68gU/wS3J BJinjHxz2R43yMnpFAYur2iLy03Wvn6rCE9s3QyI4rT4uPYX4NykkUQB6c8+uJkW gjZ2vJsQAlXBL7mbxu6DiNo+NBOUIBXVVvoyF/tHzGHb5Y0MMAId9VxZ+odBScCp RpKlkjBbbrwOlKMHLNfLQJ6YILPckOY6dSTQqMnjfJMSaxy4zXExqoG+MMm+Hc7X fGoWr5pUP5GcVAo+jF/q9q0pTlpogi0q9fBqkvyXbKtJAeYCHXkkQYecv4LklYEJ lJ7yiDx7i/nk9p2MY4JR =ZRpY -----END PGP SIGNATURE----- --AUQwVXcAo9lqRS7e--