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 1hS7bk-00080B-CC for pgsql-general@arkaria.postgresql.org; Sat, 18 May 2019 22:15:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hS7bi-0004uH-98 for pgsql-general@arkaria.postgresql.org; Sat, 18 May 2019 22:15:10 +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 1hS7bh-0004uA-Pz for pgsql-general@lists.postgresql.org; Sat, 18 May 2019 22:15:10 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hS7ba-00069F-NV for pgsql-general@lists.postgresql.org; Sat, 18 May 2019 22:15:08 +0000 Received: by mail-oi1-x234.google.com with SMTP id a132so7590913oib.2 for ; Sat, 18 May 2019 15:15:02 -0700 (PDT) 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=1NPk7lIDgdFDZ/e6RQqKK43I5i8Y6iwmhGHcxZKNORY=; b=Y1nmxw6McqeKlIPI338vU0WGtDzflP8JhYYo3+u90LDoXo7jJq5Rdy78NUzxI5b+5s NrS0CSxQrFQSV2MNa79ZqBM2zpzHmkJCcGgDENByWAXkM39/KzmUxXgc+86fDFggzeOi UGRUUFQ8WUKBFeFYlueBd0gY26eDcwmsZQU0njrd6erz1ZSnM0P3Rw4QorC951jEQf3H jLANUPxRyVarvhijKs37go4YGqiv6lLjlNHLTvl1VAmVkZhB0r6OFoRPqZnSTjcn0/7N mZwrFN87Z8+w+5QSNNqbviIW50JkLTCj4hU4Api6QQdqWlOLaeWTqthV/ZjJTaqcDv6G cFVQ== 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=1NPk7lIDgdFDZ/e6RQqKK43I5i8Y6iwmhGHcxZKNORY=; b=IhXY7/2cEEmGbzf+J/5DawxsmV/KGE3oWKRex5EThM7U5fmOIlopO5rtaTjKJb06LN 4h1w0JAc+VfwsGVJVvbO1rgZslrlJ65ztrMukmTSs6fhar0ToUiSt2zoAeo4+GCKZKls 74hQVa9FQTRALf50VmA2td4kqfn3M83wzGOQUsgT5vAxlk1KIDxcSB8jD6/xtqdC5W/r XB1gXH+QvbPdpJ5PTtcI9rk5HyJ+IFuSz8aJq5K3gicIowvByL8OoQIywsRpSOGJMJ5d +jowSmmlxrXcvPhctVWHZOSVdN5g6/OXXTP2kJg1Zcg5I1sEf0vv8pj2s3st83qJsINr X+gg== X-Gm-Message-State: APjAAAU1RQnmT4WUNqi12/7sbassZg9vZID2k7RgFiOCZYc4yQvF4/rp O9lG/K4AGZUm/IDcVjdCwPX4G5WIYKY= X-Google-Smtp-Source: APXvYqyI6zwqH4ffQBESA/3lt1gdQS6AAsIoLysUJtx4LnjrvqkW39Dyls9S1UW7NvICm6bn6IdAiQ== X-Received: by 2002:aca:4c9:: with SMTP id 192mr19309167oie.12.1558217701372; Sat, 18 May 2019 15:15:01 -0700 (PDT) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id s110sm3157482otb.34.2019.05.18.15.14.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 May 2019 15:15:00 -0700 (PDT) Subject: Re: bigint out of range To: pgsql-general@lists.postgresql.org References: <20190518093519.2kd6hyw37wcx6qwc@hjp.at> <20190518192703.ml6duizgdyfyetva@hjp.at> <20190518204941.d2o5xy2b53r266ws@hjp.at> From: Ron Message-ID: <55d8ce6e-2a94-1003-0fc1-66a39d6d2e8a@gmail.com> Date: Sat, 18 May 2019 17:14:59 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190518204941.d2o5xy2b53r266ws@hjp.at> Content-Type: multipart/alternative; boundary="------------632BF050960B2B67CF0C8C4B" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------632BF050960B2B67CF0C8C4B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 5/18/19 3:49 PM, Peter J. Holzer wrote: > On 2019-05-18 15:19:22 -0500, Ron wrote: >> On 5/18/19 2:27 PM, Peter J. Holzer wrote: >>> On 2019-05-18 10:49:53 -0700, David G. Johnston wrote: >>>> You don’t perform math on a hash >>> That's not generally true. Hashes are used for further computation for >>> example in hash tables or in cryptography. >> How is it "using math" to use a hash key in a hash lookup table? > hash modulo table size. I've seen that used when the *tablespace* is pre-allocated, and you hash modulo the tablespace *page number*.  (Yes, performance tanks when you start filling up pages.)  How do you hash on the (ever growing) table size? -- Angular momentum makes the world go 'round. --------------632BF050960B2B67CF0C8C4B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 5/18/19 3:49 PM, Peter J. Holzer wrote:
On 2019-05-18 15:19:22 -0500, Ron wrote:
On 5/18/19 2:27 PM, Peter J. Holzer wrote:
On 2019-05-18 10:49:53 -0700, David G. Johnston wrote:
You don’t perform math on a hash
That's not generally true. Hashes are used for further computation for
example in hash tables or in cryptography.
How is it "using math" to use a hash key in a hash lookup table?
hash modulo table size.

I've seen that used when the tablespace is pre-allocated, and you hash modulo the tablespace page number.  (Yes, performance tanks when you start filling up pages.)  How do you hash on the (ever growing) table size?

--
Angular momentum makes the world go 'round.
--------------632BF050960B2B67CF0C8C4B--