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 1jmB5F-0007Hm-CK for pgsql-general@arkaria.postgresql.org; Fri, 19 Jun 2020 07:05:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jmB5D-0002EI-67 for pgsql-general@arkaria.postgresql.org; Fri, 19 Jun 2020 07:05:03 +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 1jmB5C-0002EB-Uw for pgsql-general@lists.postgresql.org; Fri, 19 Jun 2020 07:05:02 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jmB5A-0000yJ-6f for pgsql-general@lists.postgresql.org; Fri, 19 Jun 2020 07:05:02 +0000 Received: by mail-ej1-x62e.google.com with SMTP id f7so9050439ejq.6 for ; Fri, 19 Jun 2020 00:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=OK6mZTxez+GEjDzJZCAukHghE3ZESI63cNogQXTYza8=; b=KNnkyPXJ86qbHpenMkwia+XVsk41KGSwl0nn3bBvq7kFnrlmQXnjj88B/GLEefIie+ oV3OVzQdMwql8mlZBz1NlcL61y3bf83R9gfZqg4CeA0svSJ36XNvxcNVZ3m8e46aU1tV eoBnzNjtEScGzUkZQ06QB9OL7sOxIKPv6E3wuctKuCYxz8H7mr5QNyDKsCMZuu4oJnvZ BMkMhJL+B5kE+CWTCzlRRXqV6Iyx7Zk2s6BdHR2wEfbZrD/Zud+/w9hvAmxR3WKBrMZD VZ/LZH6JRki+MvaQHR4+TUSWsguXMVhX9vRVzKFGtaZAfZBs0iV8YwjJE4lSsHnYSewZ h8bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=OK6mZTxez+GEjDzJZCAukHghE3ZESI63cNogQXTYza8=; b=syujN1PvS5SIRxucqC3K5okIguXlG8LUONgQrONAP9P/qoZQYKxCX/q6Z+Y8eroNb1 SL7+F1Vyb3nrpibmMmhIIomaXERTYemfykMSZ13SXZzNyeSpt9RIY4P+aUu9QUdWW6S7 gaVc69jwwHEAATtFfQPPBldXdMF8LQjrrutc7XEt0TniwYmpyl0O3+9zRgTsCp+Ara7C IYRo9eLy42TjnU+Y9CQn15jlC7B3ucEaSgVhxAPekkkKEdjzVNy0Vj5tc0yK79YKnOPr hTYKTvFOnaOl7pAy6sXaK5msHfH4EJTZSJ132iht7XTlb0HmNMUV3k63a0M5MIpjjUT1 Lb1g== X-Gm-Message-State: AOAM530QPSxUGmw0o8+KLtC7TODAKOFO7y3E7tbyaP3BzWJDcFwjGwMs lPAfhMrNRXLyxpvNb8i2w+OY2uui8UM= X-Google-Smtp-Source: ABdhPJzhtE/MTIZyRj3OKUrxpBeifX6TkNpz8FSh3URNZMesA0d8J8V8vxV7UniwZGT2y6xWjRDOyw== X-Received: by 2002:a17:906:3da1:: with SMTP id y1mr2199231ejh.109.1592550297558; Fri, 19 Jun 2020 00:04:57 -0700 (PDT) Received: from localhost.localdomain (217-149-174-45.nat.highway.telekom.at. [217.149.174.45]) by smtp.gmail.com with ESMTPSA id o16sm4123782ejg.106.2020.06.19.00.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 00:04:56 -0700 (PDT) Message-ID: Subject: Re: HASH partitioning not working properly From: Laurenz Albe To: Srinivasa T N , David Rowley Cc: PostgreSQL General Date: Fri, 19 Jun 2020 09:04:56 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 2020-06-19 at 12:12 +0530, Srinivasa T N wrote: > On Fri, Jun 19, 2020 at 11:44 AM David Rowley wrote: > > On Fri, 19 Jun 2020 at 17:42, Srinivasa T N wrote: > > > After seeing the below, I feel partitioning is not working properly or it maybe case that my understanding is wrong. Can somebody explain me what is happening? > > > > It's your understanding that's not correct. The value of is passed > > through a hash function and the partition is selected based partition > > matching the remainder value after dividing the return value of the > > hash function by the largest modulus of any partition. > > > > That might surprise you, but how would you select which partition a > > varchar value should go into if you didn't use a hash function. > > > > David > > How can I see the output of hash function that is used internally? In the case of "integer", the hash function is "pg_catalog"."hashint4". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com