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 1iTwsx-00029D-Jz for pgsql-bugs@arkaria.postgresql.org; Sun, 10 Nov 2019 23:44:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iTwsw-00078n-BQ for pgsql-bugs@arkaria.postgresql.org; Sun, 10 Nov 2019 23:44:46 +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 1iTwsv-00078e-VL for pgsql-bugs@lists.postgresql.org; Sun, 10 Nov 2019 23:44:46 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iTwss-0003r1-LF for pgsql-bugs@lists.postgresql.org; Sun, 10 Nov 2019 23:44:45 +0000 Received: by mail-lj1-x242.google.com with SMTP id p18so11784531ljc.6 for ; Sun, 10 Nov 2019 15:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=E/dsR747kgTjYuM5TGmvihpwF5k/AHYcALMJ6H3eM2E=; b=ymEwm8rM09kXI/g2lnyteD81rtXAjlk2dSOqUEmWBhZUL26X9rgVRAqigv55qCpbrW rCxNJjKQKGSXLFnbHwKwLxzGmHpKCClwgOe8fOXsTls5uI8xdp1bfVXei6Gbv2lsXFJL /To3Tox4O2KEbCMchP0IZenA+pdmIF0wDgf149TtPIY2EUYqhiggCEvophIe2Ueegxo4 IvL9HJb6jBR1vpeL9n3srX2wUEoSFF1XBNqIPhBBPeGp5cvFHmchOjrlInRLZZkf59pS vgRO6b0sQTtOIMDumoEduavuPjoKJtq0xrna+/6HDUJhRe7EOQDPuIrPDQE6csj+Lffg weDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=E/dsR747kgTjYuM5TGmvihpwF5k/AHYcALMJ6H3eM2E=; b=Qf4kw1GU6UqZAeJW+SfLSe7S7rUCewJ6NU3qL3lpUrBUZQPZ5qyXa72TvdH+sxSOLm WHHeHFr9byCnfBR1JsQfxMrJBiYz6zLwZhygQb+ArpnDXiwGbNt1/1EUpbGO4SOlH1gu X6C7558pS2UW2jVTbpw417gl8vAsqJKz+5yhOmqCrI83WhJ9hSgINkRgqGPlf+DbcI2H vIFV2rz5jUg9S4ExqZshuQr5Mp1rbPRzUAopKs4BIFxNWAh99sIi/F0uKR8/QQPJYUDf wPclZ/e0FF1PlpguQvTixm2xQHoSRUa2tmgvEg+D+/ItzzGDTWfcfYTq6gY5XAcGwaAl BVlQ== X-Gm-Message-State: APjAAAWOEQeuhsYA5PHlUQjQv4TIwsZuE8n43UQ+zDnbrLA+KR1b1OUW Fc8HmQMSsOBhtm5VlF8DVlzLBg== X-Google-Smtp-Source: APXvYqxg9vxruY7YMIMzCH95hRRUyvXR8L6alSgZ1rDti7/hFuwZr+u6oVKbjdd04LQCRorPZI8lSA== X-Received: by 2002:a2e:91c7:: with SMTP id u7mr12876152ljg.249.1573429480632; Sun, 10 Nov 2019 15:44:40 -0800 (PST) Received: from localhost ([217.8.174.100]) by smtp.gmail.com with ESMTPSA id t8sm6375909lfl.51.2019.11.10.15.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Nov 2019 15:44:39 -0800 (PST) Date: Mon, 11 Nov 2019 00:44:38 +0100 From: Tomas Vondra To: Andres Freund Cc: Thomas Munro , James Coleman , PostgreSQL mailing lists Subject: Re: BUG #16104: Invalid DSA Memory Alloc Request in Parallel Hash Message-ID: <20191110234438.qwdcur3aodd7yj6d@development> References: <20191110172925.mlkglpwzwego3wtp@development> <20191110212352.5xpzddwjs6fmuv4u@development> <20191110215017.prjisnntwhhppnru@development> <20191110224631.uxpfccnql6pxllv2@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20191110224631.uxpfccnql6pxllv2@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Nov 10, 2019 at 02:46:31PM -0800, Andres Freund wrote: >Hi, > >On 2019-11-10 22:50:17 +0100, Tomas Vondra wrote: >> On Sun, Nov 10, 2019 at 10:23:52PM +0100, Tomas Vondra wrote: >> > On Mon, Nov 11, 2019 at 10:08:58AM +1300, Thomas Munro wrote: >> > Can't we simply compute two hash values, using different seeds - one for >> > bucket and the other for batch? Of course, that'll be more expensive. >> >> Meh, I realized that's pretty much just a different way to get 64-bit >> hashes (which is what you mentioned). > >I'm not sure it's really the same, given practical realities in >postgres. Right now the "extended" hash function supporting 64 bit hash >functions is optional. So we couldn't unconditionally rely on it being >present, even in master, unless we're prepared to declare it as >required from now on. > >So computing two different hash values at the same time, by using a >different IV and a different combine function, doesn't seem like an >unreasonable approach. > True. I was commenting on the theoretical fact that computing two 32-bit hashes is close to computing a 64-bit hash, but you're right there are implementation details that may make it more usable in our case. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services