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 1hvE2S-0006Da-8D for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Aug 2019 04:59:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hvE2R-00069v-3e for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Aug 2019 04:59:03 +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 1hvE2Q-00069o-P4 for pgsql-hackers@lists.postgresql.org; Wed, 07 Aug 2019 04:59:02 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hvE2N-0005Dq-3Q for pgsql-hackers@lists.postgresql.org; Wed, 07 Aug 2019 04:59:02 +0000 Received: by mail-pg1-x544.google.com with SMTP id u17so42800654pgi.6 for ; Tue, 06 Aug 2019 21:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=tdXxRTRZie1T9F0ztNFhy9DCComLIcr+ZhKcy68dT1A=; b=WrPilv+368e8mvvQvqhJ1mHFCsFDtR68pDJ5NB+S5HFlHlYwF10Ko5rUqnis2KlSVv sHlmJ9Stqk8tGR4SqaUen5VS7jfXZQzbKwpEU+U8T0crxFyJSJsOKEv5bYSORWDqc5dt wShLC8yN7nU6rqB5ZFHczK2Lt0+KhyI5T7zefFljpDlbC9GYGVV5iCz3I0xHjrAvkei2 tTnNpOWSL+Th35rrw4PPJ7p1aSUaH6ICQW72enBCy4XS6WEwJt77yRZ3nnNMxMj/5JnD 3MT/7gxdGRBJCIxJhkUceChz4N/14ZUYxA2iG1qMdzUKl8Of9hbq9phc0Y3I/O8Zof4Z jxOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=tdXxRTRZie1T9F0ztNFhy9DCComLIcr+ZhKcy68dT1A=; b=kwSneD8mBZho+C3UBmu8d+YE1PPfk/dCj2lVN1HoHH2DLvtTeyUnwrdPK86q+20SIb pmDIEy6kpmArVOF3GQG0yY4F2wbNHKLACzoHlPDbXchDzZJaC3f6hWZwef4TZPFJX0Mb H9dbsyC1HBC69AOlyFe+oKPYRPBVhQ1Td5CVLnbhXNzdvhEBS7zxxqDh0GbiHcK+BBsQ EFg3QZSg4XEZroSQ/Q29PdKemQ1GOCuFbsOJK5cdUrIHqxFUOGmAj4tuwlaYRAdif1HI H/XGbn+P8D26bp7dE4UGBQ2IAcnCsaaPBEJx1IT64GI8xTaasOCpdzfUw9qWvh0vnB6I S32Q== X-Gm-Message-State: APjAAAVg+V2kmcp+x2NYZp2nwN0xiGxPLYmMduheK5jXN8PVqoSFF/b6 /1WpF4hFemtaTnc5Iklow2U= X-Google-Smtp-Source: APXvYqxsiW4x+BSIbZcG+D3VskrXzs3gE8TECQUBpUBFOyM1/zWEFjVaH05KX4GKD04JiWl3zugYDg== X-Received: by 2002:a63:ea50:: with SMTP id l16mr6239744pgk.160.1565153936052; Tue, 06 Aug 2019 21:58:56 -0700 (PDT) Received: from localhost (w204177.dynamic.ppp.asahi-net.or.jp. [121.1.204.177]) by smtp.gmail.com with ESMTPSA id 185sm98714836pfa.170.2019.08.06.21.58.52 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 06 Aug 2019 21:58:55 -0700 (PDT) Date: Wed, 07 Aug 2019 13:58:34 +0900 (Tokyo Standard Time) Message-Id: <20190807.135834.105525400.horikyota.ntt@gmail.com> To: robertmhaas@gmail.com Cc: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, pgsql-hackers@lists.postgresql.org Subject: Re: no default hash partition From: Kyotaro Horiguchi In-Reply-To: References: <20190806225310.GA17708@alvherre.pgsql> <16738.1565132324@sss.pgh.pa.us> User-Agent: Mew version 6.5 on Emacs 22.2 / Mule 5.0 =?iso-2022-jp?B?KBskQjpnGyhCKQ==?= / Meadow-3.01-dev (TSUBO-SUMIRE) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk At Tue, 6 Aug 2019 23:26:19 -0400, Robert Haas wrote in > On Tue, Aug 6, 2019 at 6:58 PM Tom Lane wrote: > I think, as Amit says, that having an automatic partition creation > feature for hash partitions (and maybe other kinds, but certainly for > hash) would be a useful thing to add to the system. I also think that > it might be useful to add some commands to automate partition > splitting (and maybe combining) although I think there's some design > work to be done there to figure out exactly what we should build. I > don't think it's ever useful to have a hash-partitioned table with an > incomplete set of partitions long term, but it makes things simpler to > allow that temporarily, for example during dump restoration. > Therefore, I see no reason why we would want to go to the trouble of > allowing hash-partitioned tables to have default partitions; it would > just encourage people to do things that don't really make any sense. +1. By the way, couldn't we offer a means to check for gaps in a hash partition? For example, the output of current \d+ contains the Partitoins section that shows a list of partitions. I think that we can show all gaps there. =# \d+ p Partitioned table "public.p" ... Partition key: HASH (a) Partitions: c1 FOR VALUES WITH (modulus 4, remainder 0), c3 FOR VALUES WITH (modulus 4, remainder 3), GAP (modulus 4, remainder 1), GAP (modulus 4, remainder 2) Or Partitions: c1 FOR VALUES WITH (modulus 4, remainder 0), c3 FOR VALUES WITH (modulus 4, remainder 3), Gaps: (modulus 4, remainder 1), (modulus 4, remainder 2) regards. -- Kyotaro Horiguchi NTT Open Source Software Center