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 1hvCut-00047r-N8 for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Aug 2019 03:47:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hvCuq-000597-MM for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Aug 2019 03:47:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hvCuq-00057w-9X for pgsql-hackers@lists.postgresql.org; Wed, 07 Aug 2019 03:47:08 +0000 Received: from xvm-110-146.dc2.ghst.net ([46.226.110.146] helo=fetter.org) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1hvCuj-0000r5-2O for pgsql-hackers@lists.postgresql.org; Wed, 07 Aug 2019 03:47:06 +0000 Received: by fetter.org (Postfix, from userid 1001) id 1E92440998; Wed, 7 Aug 2019 05:46:59 +0200 (CEST) Date: Wed, 7 Aug 2019 05:46:58 +0200 From: David Fetter To: Tom Lane Cc: Alvaro Herrera , Pg Hackers Subject: Re: no default hash partition Message-ID: <20190807034658.GT31493@fetter.org> References: <20190806225310.GA17708@alvherre.pgsql> <16738.1565132324@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16738.1565132324@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Aug 06, 2019 at 06:58:44PM -0400, Tom Lane 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? > > > 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. > > 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? +1 for requiring that hash partitions not have gaps, ideally by making one call create all the partitions. Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate