Re: Optimize partial TOAST decompression

From: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Binguo Bao <djydewang(at)gmail(dot)com>, Paul Ramsey <pramsey(at)cleverelephant(dot)ca>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimize partial TOAST decompression
Date: 2019-11-14 09:57:42
Message-ID: CAGPqQf2a4+6BKnLC+-b0kEc-02nBfosV=bf8qDRQa+y30N+tNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Today I noticed strange behaviour, consider the following test:

postgres(at)126111=#create table foo ( a text );
CREATE TABLE
postgres(at)126111=#insert into foo values ( repeat('PostgreSQL is the
world''s best database and leading by an Open Source Community.', 8000));
INSERT 0 1

postgres(at)126111=#select substring(a from 639921 for 81) from foo;
substring
-----------

(1 row)

Before below commit:

commit 540f31680913b4e11f2caa40cafeca269cfcb22f
Author: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
Date: Tue Oct 1 16:53:04 2019 +0200

Blind attempt to fix pglz_maximum_compressed_size

Commit 11a078cf87 triggered failures on big-endian machines, and the
only plausible place for an issue seems to be that TOAST_COMPRESS_SIZE
calls VARSIZE instead of VARSIZE_ANY. So try fixing that blindly.

Discussion:
https://www.postgresql.org/message-id/20191001131803.j6uin7nho7t6vxzy%40development

postgres(at)75761=#select substring(a from 639921 for 81) from foo;

substring

----------------------------------------------------------------------------------
PostgreSQL is the world's best database and leading by an Open Source
Community.
(1 row)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2019-11-14 10:09:56 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Nikolay Shaplov 2019-11-14 08:20:25 Re: [PATCH] Do not use StdRdOptions in Access Methods