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 1kdf76-0001s1-4E for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Nov 2020 19:52:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kdf74-0005zp-0x for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Nov 2020 19:52:02 +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 1kdf73-0005zh-Qb for pgsql-hackers@lists.postgresql.org; Fri, 13 Nov 2020 19:52:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdf6w-00089k-BW for pgsql-hackers@postgresql.org; Fri, 13 Nov 2020 19:52:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0ADJpmtW395785; Fri, 13 Nov 2020 14:51:48 -0500 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers , Andres Freund Subject: Re: Hash support for row types In-reply-to: References: <38eccd35-4e2d-6767-1b3c-dada1eac3124@2ndquadrant.com> <20201019233234.r6lyxbvdg5s77rvd@alap3.anarazel.de> Comments: In-reply-to Peter Eisentraut message dated "Fri, 23 Oct 2020 09:49:15 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <395783.1605297108.1@sss.pgh.pa.us> Date: Fri, 13 Nov 2020 14:51:48 -0500 Message-ID: <395784.1605297108@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Eisentraut writes: > Here is an updated patch with the type cache integration added. > To your point, this now checks each fields hashability before > considering a row type as hashable. It can still have run-time errors > for untyped record datums, but that's not something we can do anything > about. This looks good code-wise. A couple small niggles on the tests: * The new test in with.sql claims to be testing row hashing, but it's not very apparent that any such thing actually happens. Maybe EXPLAIN the query, as well as execute it, to confirm that a hash-based plan is used. * Is it worth devising a test case in which hashing is not possible because one of the columns isn't hashable? I have mixed feelings about this because the set of suitable column types may decrease to empty over time, making it hard to maintain the test case. I marked it RFC. regards, tom lane