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 1jmHJ7-0001yb-GB for pgsql-general@arkaria.postgresql.org; Fri, 19 Jun 2020 13:43:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jmHJ5-00036q-Fl for pgsql-general@arkaria.postgresql.org; Fri, 19 Jun 2020 13:43:47 +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 1jmHJ5-00035o-4H for pgsql-general@lists.postgresql.org; Fri, 19 Jun 2020 13:43:47 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jmHJ1-0004dF-Tx for pgsql-general@lists.postgresql.org; Fri, 19 Jun 2020 13:43:46 +0000 Received: by mail-ej1-x62d.google.com with SMTP id p20so10199513ejd.13 for ; Fri, 19 Jun 2020 06:43:43 -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=uvTDkAqC6YWEmUv+wsC2n0GUCEf2E0w9iNiyX0hNnBw=; b=Ld6dc23CYbfA20Avu6S9gHXduSIT6WmJUm+DinHGBfRB4Gtu8J5Qomz0goltPRDRO3 r3y/toGvORqtYMuz2EXvuITr8yKL12ECPlqakZb/vw8YZcQv09ZiKOg/B8mxU/RYOxq3 F9rOQ/yyM8m1+1ssuFhk6QrLkCNE1Ls8ukQBnK/MrWz+MvZF4MgrRTj2d5XppUXFhY7q 7xDpYOB9lxLwkPbyeqoqR4kB3azsWSH6a61OmGwGqibjqSWQvUi4e8Kk1OINUad9F/P4 SVSPj5D1SwymWVMktOARSpsgL4VGWM2R1yAwngrIcCevOTAO0pHOFCoFIvX6kEV8HI/s H5hg== 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=uvTDkAqC6YWEmUv+wsC2n0GUCEf2E0w9iNiyX0hNnBw=; b=RtGyzfuH2aM3L5Y+8a+KJ+1tHcx7ZF+bklzEWJPfIiTJsRBHcOnRh++zozINjIfvUk 6mwrplMNS3D46gMcF4dlAVuGv0s3r+CZfGmle8NEyCjswSNYQWaUpSnoLHV5R36Jr6+v jWoHufuIICHTD/9c4rCRuO3t/DY1eIc7Bu0Ch6KM9iT4W6jMiKG0RhP+9pEgSjXYW3qQ Ww5rj1fJgg6b4FUBeMLUHKYamsGWNvqStG6gfCC2qJ/Xl1EyGybSd0AYHIuxKIzFMFmJ llsn0vnr89UcOjKn58J8C/eXSdLfk4IFi6LFwrWMXhVZ40dm5lcJKipDDL6f2k4sLnFl egGA== X-Gm-Message-State: AOAM531Pf2i0kwjMM9qzOL5gaHAOy2BLd4IjW9rP572PtxjS2AoSBc5N OkIsS5xBYC/9mj5MPKxrLeyyTA== X-Google-Smtp-Source: ABdhPJxug6aNw5LusXAyJRirIv1zzNK4pLt5PgsKfKTQ8yf9/UW7yixRpJuKOZNbtemb/6QHLopESw== X-Received: by 2002:a17:906:76c4:: with SMTP id q4mr3891582ejn.371.1592574222075; Fri, 19 Jun 2020 06:43:42 -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 g22sm4812349ejo.1.2020.06.19.06.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 06:43:41 -0700 (PDT) Message-ID: <219b96f22844aa5408285ef7d4a049af56fb7915.camel@cybertec.at> Subject: Re: HASH partitioning not working properly From: Laurenz Albe To: Srinivasa T N Cc: David Rowley , PostgreSQL General Date: Fri, 19 Jun 2020 15:43:40 +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 13:27 +0530, Srinivasa T N wrote: > > > 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". > > I guess output formatting is wrong, any help? > > postgres=# select pg_catalog.hashint4(7); > hashint4 > ------------ > -978793473 > (1 row) No, that is fine. Just take the result mod 10 if that is how hash partitioning was defined: select pg_catalog.hashint4(7) - floor(pg_catalog.hashint4(7) / 10.0) * 10; ?column? ---------- 7 (1 row) So that should end up in the eighth partition. You have no choice which hash function to use for partitioning. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com