Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s168J-009QFA-7e for pgsql-general@arkaria.postgresql.org; Sun, 28 Apr 2024 15:08:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s168G-00DIUO-7Q for pgsql-general@arkaria.postgresql.org; Sun, 28 Apr 2024 15:08:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s168E-00DITo-IK for pgsql-general@lists.postgresql.org; Sun, 28 Apr 2024 15:08:00 +0000 Received: from wfhigh1-smtp.messagingengine.com ([64.147.123.152]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s168B-000T8v-QR for pgsql-general@lists.postgresql.org; Sun, 28 Apr 2024 15:07:58 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.west.internal (Postfix) with ESMTP id AD4FE18000DC; Sun, 28 Apr 2024 11:07:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 28 Apr 2024 11:07:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1714316870; x=1714403270; bh=r1eNNOhZSpElqHnzCR7hEzj66WGZ4Oq7XVmWyj8Wlfk=; b= pPoj7JDncT5+Wp2tl1VKytpb9H2aYzpL0/K7fg4n8EfBk5Y1ElOpBYE3ZXnRCw0w 9VfGHUMH+qQSU9hzwVGwvaVlamzo0jsnxad3uB1jhGCq/3vZCr/H+NBz6MSpzJ0O /m4XCHgCCVMgdK3iBPj7z0aYi9k83L1pcFUBGuwxI5GOEwud/I84s01rNfTHdOB9 E1X5+zHDgGBNOr0GWX9mmXsa+/quZjg6glNKkCowizIrhlucgBUc5eWsUkm1TVyo JGMrKdS8CxT86XECAWDGRpJ/BTn45ieJOyyh2AGo22V0AsMaLJOb3lmfavCpw+4e X3Z3mf10ZaIcdfoWYcPCtg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714316870; x= 1714403270; bh=r1eNNOhZSpElqHnzCR7hEzj66WGZ4Oq7XVmWyj8Wlfk=; b=Z U8GcnRaYR0i2rNS5HHysTkaQMYD1LULbbQTTYaB5eXMSZeO2eKXIUufHf+aVGGYb okjVkOK0gYvGZgroR2Lzq+xAYh9rxGwOo+O0JdpOwVm7q2ZupDIpi1Y7JYfnCli0 mFqCeu61Fw4tElFfeAuXsQaJTDflAaLQ6rIwYPJ4uQ3lAZTumC9oyaoPlzBc7WYa /wm2XRtEsC3I45o5aIJC/JwlYw3B8o/WIqEtzttogcrG4BjfBfLSskpN8x1u7HMR sfeuZn3pnJddU968LlYve168PKSqw+kARm8ZakdB2vzjUbdZdMCrcfA/hw3vhsP+ p3CCKIKuTS1CFn6l8pPAg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddtgedguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepkeefhfffgfelgfejheehleehvdegffefleffvdev tdeiffeuhfeivdevtdelhfejnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 28 Apr 2024 11:07:49 -0400 (EDT) Message-ID: Date: Sun, 28 Apr 2024 08:07:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Query Discrepancy in Postgres HLL Test To: Ayush Vatsa , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/28/24 06:01, Ayush Vatsa wrote: > Hi PostgreSQL Community, > I'm currently delving into Postgres HLL (HyperLogLog) functionality and > have encountered an unexpected behavior while executing queries from the > "cumulative_add_sparse_edge.sql > " regress test. This particular test data file involves three columns, with the last column representing an HLL (HyperLogLog) value derived from the previous HLL value and the current raw value. > > Upon manual inspection of the query responsible for deriving the last > row's HLL value, I noticed a discrepancy. When executing the query: > """ > -- '\x148B481002....' is second last rows hll value > SELECT hll_add('\x148B481002.....', hll_hashval(2561)); > """ > instead of obtaining the expected value (''\x148B481002....''), I > received a different output which is ('\x138b48000200410061008100a1 > ........'). > > My initial assumption is that this could potentially be attributed to a > precision error. However, I'm reaching out to seek clarity on why this > disparity is occurring and to explore potential strategies for > mitigating it (as I want the behaviour to be consistent to regress test > file). I would say your best option is to file an issue here: https://github.com/citusdata/postgresql-hll/issues > > Regards > Ayush Vatsa -- Adrian Klaver adrian.klaver@aklaver.com