pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Mark Dilger <mark.dilger@enterprisedb.com>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: pglz compression performance, take two
Date: Thu, 4 Nov 2021 21:47:16 +0100
Message-ID: <84aa2da0-004d-c8f8-48c8-aa2861d1ff73@enterprisedb.com> (raw)
In-Reply-To: <B1D3105C-D68B-445F-B3DF-E3F41FE79C46@enterprisedb.com>
References: <FEF3DC5E-4BC4-44E1-8DEB-DADC67046FE3@yandex-team.ru>
	<D75ABE30-2AAA-47DB-A89F-665E03BAAD2A@yandex-team.ru>
	<25991595-1848-4178-AA57-872B10309DA2@yandex-team.ru>
	<20201230043930.GG25152@telsasoft.com>
	<BF0A7E6D-AB21-47F8-A5FA-328CAA32DB12@yandex-team.ru>
	<20210122024811.GE27167@telsasoft.com>
	<EB24F56E-901B-46D6-BFFC-71D51603ABDE@enterprisedb.com>
	<88C049C6-1B86-4EF7-940D-585B07FEB81B@yandex-team.ru>
	<90649B7F-EF71-40F7-93D0-1029AD0D90F3@enterprisedb.com>
	<B1D3105C-D68B-445F-B3DF-E3F41FE79C46@enterprisedb.com>

Hi,

I've looked at this patch again and did some testing. I don't have any 
comments to the code (I see there are two comments from Mark after the 
last version, though).

For the testing, I did a fairly simple benchmark loading either random 
or compressible data into a bytea column. The tables are defined as 
unlogged, the values are 1kB, 4kB and 1MB, and the total amount of data 
is always 1GB. The timings are

     test           master     patched    delta
     ------------------------------------------
     random_1k      12295        12312     100%
     random_1m      12999        12984     100%
     random_4k      16881        15959      95%
     redundant_1k   12308        12348     100%
     redundant_1m   16632        14072      85%
     redundant_4k   16798        13828      82%

I ran the test on multiple x86_64 machines, but the behavior is almost 
exactly the same.

This shows there's no difference for 1kB (expected, because this does 
not exceed the ~2kB TOAST threshold). For random data in general the 
difference is pretty negligible, although it's a bit strange it takes 
longer for 4kB than 1MB ones.

For redundant (highly compressible) values, there's quite significant 
speedup between 15-18%. Real-world data are likely somewhere between, 
but the speedup is still pretty nice.

Andrey, can you update the patch per Mark's review? I'll do my best to 
get it committed sometime in this CF.

Attached are the two scripts used for generating / testing (you'll have 
to fix some hardcoded paths, but simple otherwise).

regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachments:

  generator.sql (application/sql, 2.1K) download

  test.sh (application/x-shellscript, 585B) download

view thread (32+ messages)  latest in thread

Message-ID: <84aa2da0-004d-c8f8-48c8-aa2861d1ff73@enterprisedb.com>
Permalink:  ../84aa2da0-004d-c8f8-48c8-aa2861d1ff73@enterprisedb.com/
Also on:    postgresql.org/message-id/84aa2da0-004d-c8f8-48c8-aa2861d1ff73@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@enterprisedb.com, mark.dilger@enterprisedb.com, x4mmm@yandex-team.ru, pryzby@telsasoft.com
  Subject: Re: pglz compression performance, take two
  In-Reply-To: <84aa2da0-004d-c8f8-48c8-aa2861d1ff73@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox