Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzM0o-0006cg-HE for pgsql-general@arkaria.postgresql.org; Tue, 12 Jan 2021 15:55:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kzM0n-0001D0-Dw for pgsql-general@arkaria.postgresql.org; Tue, 12 Jan 2021 15:55:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzM0n-0001Ct-4g for pgsql-general@lists.postgresql.org; Tue, 12 Jan 2021 15:55:13 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kzM0k-0004v8-4i for pgsql-general@lists.postgresql.org; Tue, 12 Jan 2021 15:55:12 +0000 Received: by mail-io1-xd30.google.com with SMTP id n4so5006769iow.12 for ; Tue, 12 Jan 2021 07:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=AWqDQxQHFgc35M9jylZBbUhaMzpaaBeEzM1OTFcxAtU=; b=fVbz+koI4m3DsdtnEXdsJkuubQUyRur1znegYS0DXsimc/3TRL5cp+2R1EkKxTJl6o zDQYqHy7NxJlMZ8hdq8yWO0lg03owNfUttOGW4ewyHfgEVOgvbDCNQLLyHtcILKEYVsy j2Hxs5+HKdRHsaZmvgmjNf5MQSm//u5s/BQptX7kRT/fZsVT5EzIx3Vof24s7heAZjin b7DBDILKT6ZxB4DY9lTKDTPtq6ohx8939zAt2PeXBGVcW/OYVEurTn4I46J3EeZ7OREl 0pZBBcEYvRhVjl3reqATlcd6p3etLGaglnW+5veHZLM9D9UgQabymMZ3Z7yFDgW6G8t/ o8nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=AWqDQxQHFgc35M9jylZBbUhaMzpaaBeEzM1OTFcxAtU=; b=IhbAahJFntpzSEl76jrJthAQyWExvEi0W/W6q81RklFQtthpON2ebdvNGE3QvsrhCo LSn8awQ0WJkxcBTCb3e6dFB7dU59S7CIBQPRCAJ7FUbbQZStR59BKz4y302Vql4N+1l2 /LXGUxpmfQh4kcN+/dRCLWDBKDjbbxRqpqRe7VVRG+EBGOz3W1RhC5/QqisjJe6eU8Eb CLK40Pa7PZddRcW3qwOiD0wZBdpakeptS8z1tZaO789Bkn7GyfAUs4eqVaY4xlkRxNWo JkIHCZ1aQXBaqdB1cXyBgN/SgfFLEU00IQXlOatMOWTOjWv0EHtW3+HWza2/JUNPUDzG 5dOQ== X-Gm-Message-State: AOAM532i+0oqSlLWz2khMbWHi5dL0U1qcs+WqV/0d9+qO4VuxzDtAzdz zDKR4BGCEXzUKNyzbhe6IEATH7J0x9zzqQ== X-Google-Smtp-Source: ABdhPJy0cJ+1Jtb/g87YIMu0cbFgCDIHJ+rCuqQjNm1k5hdfaZ4zqOZHYGvAReRtkDteW46up6oJ1g== X-Received: by 2002:a02:7428:: with SMTP id o40mr34347jac.130.1610466907919; Tue, 12 Jan 2021 07:55:07 -0800 (PST) Received: from ?IPv6:2601:681:5500:dde0:8511:e790:526e:7666? ([2601:681:5500:dde0:8511:e790:526e:7666]) by smtp.gmail.com with ESMTPSA id s4sm2265586ioc.33.2021.01.12.07.55.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Jan 2021 07:55:07 -0800 (PST) Subject: Re: Define hash partition for certain column values To: pgsql-general@lists.postgresql.org References: <2278581610342154@mail.yandex.ru> <820805.1610346968@sss.pgh.pa.us> <987221610348608@mail.yandex.ru> <684591610466070@mail.yandex.ru> From: Rob Sargent Message-ID: <1d449205-4570-fa8e-0b82-f5c3412f080a@gmail.com> Date: Tue, 12 Jan 2021 08:55:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <684591610466070@mail.yandex.ru> Content-Type: multipart/alternative; boundary="------------8853DE7DCC598E6CDF5B164B" Content-Language: en-CA List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------8853DE7DCC598E6CDF5B164B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 1/12/21 8:51 AM, Голубева Яна wrote: > Values for the key partitioning column are generated randomly and I > can't predict their distribution between ranges. > If I just create some ranges I won't have any guarantee that > partitions will have similar amount of data. It is possible that I > will have 2 or 3 extremely big partitions and a bit of data in others. > Thank you, > Iana Golubeva > > > 12.01.2021, 17:55, "Michael Lewis" : > > On Tue, Jan 12, 2021 at 1:21 AM Голубева Яна > wrote: > > List or range partitioning isn't suitable for my case. > I am using a column of numeric(20) type as a base for > partitioning. The values of the column are generated randomly. > So there will be too many partitions if I use list > partitioning as is. > > > Sorry, but why is range not suited for this? It would seem fairly > trivial to create 50 or 1000 partitions to break up the range of > values allowed by your field definition. > Doesn't sound like a good definition of random. --------------8853DE7DCC598E6CDF5B164B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

On 1/12/21 8:51 AM, Голубева Яна wrote:
Values for the key partitioning column are generated randomly and I can't predict their distribution between ranges.
If I just create some ranges I won't have any guarantee that partitions will have similar amount of data. It is possible that I will have 2 or 3 extremely big partitions and a bit of data in others.
 
Thank you,
Iana Golubeva


12.01.2021, 17:55, "Michael Lewis" <mlewis@entrata.com>:
On Tue, Jan 12, 2021 at 1:21 AM Голубева Яна <ishsha@yandex.ru> wrote:
List or range partitioning isn't suitable for my case.
I am using a column of numeric(20) type as a base for partitioning. The values of the column are generated randomly. 
So there will be too many partitions if I use list partitioning as is.

Sorry, but why is range not suited for this? It would seem fairly trivial to create 50 or 1000 partitions to break up the range of values allowed by your field definition.
Doesn't sound like a good definition of random.
--------------8853DE7DCC598E6CDF5B164B--