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 1iFK4p-0001H0-EQ for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Oct 2019 15:28:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iFK4o-0005V4-8h for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Oct 2019 15:28:34 +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 1iFK4o-0005Ut-0x for pgsql-bugs@lists.postgresql.org; Tue, 01 Oct 2019 15:28:34 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iFK4m-0007VG-1s for pgsql-bugs@lists.postgresql.org; Tue, 01 Oct 2019 15:28:33 +0000 Received: from [192.168.127.1] (port=20941 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1iFK4j-000G77-FX; Tue, 01 Oct 2019 15:28:29 +0000 Received: from localhost ([127.0.0.1]:32145 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.92.1 (FreeBSD)) (envelope-from ) id 1iFK4j-000DFV-Ax; Tue, 01 Oct 2019 15:28:29 +0000 From: Andrew Gierth To: David Raymond Cc: Peter Geoghegan , Tom Lane , "pgsql-bugs\@lists.postgresql.org" Subject: Re: BUG #16031: Group by returns duplicate groups In-Reply-To: (David Raymond's message of "Tue, 1 Oct 2019 15:22:26 +0000") Message-ID: <87o8z0lc6i.fsf@news-spur.riddles.org.uk> References: <16031-4ef55395a5fbb687@postgresql.org> <18850.1569867434@sss.pgh.pa.us> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (berkeley-unix) Date: Tue, 01 Oct 2019 16:28:29 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "David" == David Raymond writes: David> Here's what it's reporting for an error: David> testing=# select bt_index_check('big_table_name_id_1_id_2_idx', true); David> ERROR: high key invariant violated for index "big_table_name_id_1_id_2_idx" David> DETAIL: Index tid=(86990,140) points to heap tid=(139313,57) page lsn=0/0. David> Time: 65695.359 ms (01:05.695) David> testing=# select bt_index_parent_check('big_table_name_id_1_id_2_idx', true); David> ERROR: down-link lower bound invariant violated for index "big_table_name_id_1_id_2_idx" David> DETAIL: Parent block=43131 child index tid=(43197,9) parent page lsn=0/0. David> Time: 1697.205 ms (00:01.697) David> testing=# Based on the other response, it looks like something is fundamentally broken with regard to sorting this dataset, and since btree index build works by sorting, the index corruption is probably just another symptom of the real problem rather than a cause in itself. -- Andrew (irc:RhodiumToad)