Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dN1mO-0005AZ-KQ for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jun 2017 18:52:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dN1mO-0004GJ-2U for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jun 2017 18:52:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dN1GK-00030o-1f; Mon, 19 Jun 2017 18:18:56 +0000 Received: from mailhub130.itcs.purdue.edu ([128.210.5.130]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dN1GH-0000aU-1U; Mon, 19 Jun 2017 18:18:54 +0000 Received: from gibbs.math.purdue.edu (gibbs.math.purdue.edu [10.164.4.43]) by mailhub130.itcs.purdue.edu (8.14.4/8.14.4/mta.smtp.purdue.edu) with ESMTP id v5JIIoua007664; Mon, 19 Jun 2017 14:18:50 -0400 Subject: Re: Postgresql bug report - unexpected behavior of suppress_redundant_updates_trigger To: Dilip Kumar , Artus de benque Cc: pgsql-bugs@postgresql.org, pgsql-hackers References: From: J Chapman Flack Message-ID: <3b45ea7f-3434-8d97-9177-f1174131fc9a@math.purdue.edu> Date: Mon, 19 Jun 2017 14:18:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-PMX-Version: 6.0.2.2308539 X-PerlMx-URL-Scanned: Yes X-PerlMx-Virus-Scanned: Yes List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 06/19/2017 11:40 AM, Dilip Kumar wrote: > ... Artus de benque ... wrote: >> ...=# UPDATE test_table SET field = rpad('', 2001, 'a') WHERE id = 1; > > Seems like in "suppress_redundant_updates_trigger" we are comparing > toasted tuple with the new tuple and that is the cause of the bug. Something still puzzles me about this, though, maybe only because I don't know enough about TOAST. The size of 'field' ends up 2001, or just over the threshold where TOASTing will be attempted at all. The report doesn't mention changing the strategy from the default EXTENDED, so won't the first thing attempted be compression? Won't that succeed spectacularly, since the test string is a single character 2001 times, probably producing a compressed string a handful of bytes long, well under the threshold, obviating any need to go further with TOAST pointers? Is the compression algorithm nondeterministic? Is there some way that compressing the same 2001*'a' on two occasions would produce compressed strings that don't match? What exactly is s_r_u_t() comparing, in the case where the TOASTed value has been compressed, but not out-of-lined? -Chap -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers