Re: Compress ReorderBuffer spill files using LZ4

2024-09-24 Thread Tomas Vondra
On 9/23/24 21:58, Julien Tachoires wrote: > Hi Tomas, > > Le lun. 23 sept. 2024 à 18:13, Tomas Vondra a écrit : >> >> Hi, >> >> I've spent a bit more time on this, mostly running tests to get a better >> idea of the practical benefits. > > Thank you for your code review and testing! > >> Fir

Re: Compress ReorderBuffer spill files using LZ4

2024-09-23 Thread Julien Tachoires
Hi Tomas, Le lun. 23 sept. 2024 à 18:13, Tomas Vondra a écrit : > > Hi, > > I've spent a bit more time on this, mostly running tests to get a better > idea of the practical benefits. Thank you for your code review and testing! > Firstly, I think there's a bug in ReorderBufferCompress() - it's l

Re: Compress ReorderBuffer spill files using LZ4

2024-09-23 Thread Tomas Vondra
Hi, I've spent a bit more time on this, mostly running tests to get a better idea of the practical benefits. Firstly, I think there's a bug in ReorderBufferCompress() - it's legal for pglz_compress() to return -1. This can happen if the data is not compressible, and would not fit into the output

Re: Compress ReorderBuffer spill files using LZ4

2024-07-17 Thread Amit Kapila
On Tue, Jul 16, 2024 at 7:31 PM Tomas Vondra wrote: > > On 7/16/24 14:52, Amit Kapila wrote: > > On Tue, Jul 16, 2024 at 12:58 AM Tomas Vondra > > wrote: > >> > >> FWIW I'd expect that to be handled at the libpq level - there's already > >> a patch for that, but I haven't checked if it would hand

Re: Compress ReorderBuffer spill files using LZ4

2024-07-16 Thread Tomas Vondra
On 7/16/24 14:52, Amit Kapila wrote: > On Tue, Jul 16, 2024 at 12:58 AM Tomas Vondra > wrote: >> >> On 7/15/24 20:50, Julien Tachoires wrote: >>> Hi, >>> >>> Le ven. 7 juin 2024 à 06:18, Julien Tachoires a écrit : Le ven. 7 juin 2024 à 05:59, Tomas Vondra a écrit : > >

Re: Compress ReorderBuffer spill files using LZ4

2024-07-16 Thread Amit Kapila
On Tue, Jul 16, 2024 at 12:58 AM Tomas Vondra wrote: > > On 7/15/24 20:50, Julien Tachoires wrote: > > Hi, > > > > Le ven. 7 juin 2024 à 06:18, Julien Tachoires a écrit : > >> > >> Le ven. 7 juin 2024 à 05:59, Tomas Vondra > >> a écrit : > >>> > >>> On 6/6/24 12:58, Julien Tachoires wrote: > >>>

Re: Compress ReorderBuffer spill files using LZ4

2024-07-16 Thread Julien Tachoires
Le lun. 15 juil. 2024 à 12:28, Tomas Vondra a écrit : > > On 7/15/24 20:50, Julien Tachoires wrote: > > The last patch of this set is still in WIP, it adds the machinery > > required for setting the compression methods as a subscription option: > > CREATE SUBSCRIPTION ... WITH (spill_compression =

Re: Compress ReorderBuffer spill files using LZ4

2024-07-15 Thread Tomas Vondra
On 7/15/24 20:50, Julien Tachoires wrote: > Hi, > > Le ven. 7 juin 2024 à 06:18, Julien Tachoires a écrit : >> >> Le ven. 7 juin 2024 à 05:59, Tomas Vondra >> a écrit : >>> >>> On 6/6/24 12:58, Julien Tachoires wrote: ... When compiled with LZ4 support (--with-lz4), this patch ena

Re: Compress ReorderBuffer spill files using LZ4

2024-06-07 Thread Julien Tachoires
Le ven. 7 juin 2024 à 05:59, Tomas Vondra a écrit : > > On 6/6/24 12:58, Julien Tachoires wrote: > > ... > > > > When compiled with LZ4 support (--with-lz4), this patch enables data > > compression/decompression of these temporary files. Each transaction > > change that must be written on disk (Re

Re: Compress ReorderBuffer spill files using LZ4

2024-06-07 Thread Tomas Vondra
On 6/6/24 12:58, Julien Tachoires wrote: > ... > > When compiled with LZ4 support (--with-lz4), this patch enables data > compression/decompression of these temporary files. Each transaction > change that must be written on disk (ReorderBufferDiskChange) is now > compressed and encapsulated in a ne

Re: Compress ReorderBuffer spill files using LZ4

2024-06-07 Thread Tomas Vondra
On 6/6/24 16:24, Alvaro Herrera wrote: > On 2024-Jun-06, Amit Kapila wrote: > >> On Thu, Jun 6, 2024 at 4:28 PM Julien Tachoires wrote: >>> >>> When the content of a large transaction (size exceeding >>> logical_decoding_work_mem) and its sub-transactions has to be >>> reordered during logical de

Re: Compress ReorderBuffer spill files using LZ4

2024-06-07 Thread Amit Kapila
On Fri, Jun 7, 2024 at 2:08 PM Dilip Kumar wrote: > > I think the compression option should be supported at the CREATE > SUBSCRIPTION level instead of being controlled by a GUC. This way, we > can decide on compression for each subscription individually rather > than applying it to all subscribers

Re: Compress ReorderBuffer spill files using LZ4

2024-06-07 Thread Amit Kapila
On Thu, Jun 6, 2024 at 7:54 PM Alvaro Herrera wrote: > > On 2024-Jun-06, Amit Kapila wrote: > > > On Thu, Jun 6, 2024 at 4:28 PM Julien Tachoires wrote: > > > > > > When the content of a large transaction (size exceeding > > > logical_decoding_work_mem) and its sub-transactions has to be > > > re

Re: Compress ReorderBuffer spill files using LZ4

2024-06-07 Thread Dilip Kumar
On Fri, Jun 7, 2024 at 2:39 PM Alvaro Herrera wrote: > > On 2024-Jun-07, Dilip Kumar wrote: > > > I think the compression option should be supported at the CREATE > > SUBSCRIPTION level instead of being controlled by a GUC. This way, we > > can decide on compression for each subscription individua

Re: Compress ReorderBuffer spill files using LZ4

2024-06-07 Thread Alvaro Herrera
On 2024-Jun-07, Dilip Kumar wrote: > I think the compression option should be supported at the CREATE > SUBSCRIPTION level instead of being controlled by a GUC. This way, we > can decide on compression for each subscription individually rather > than applying it to all subscribers. It makes more s

Re: Compress ReorderBuffer spill files using LZ4

2024-06-07 Thread Dilip Kumar
On Thu, Jun 6, 2024 at 7:54 PM Alvaro Herrera wrote: > > On 2024-Jun-06, Amit Kapila wrote: > > > On Thu, Jun 6, 2024 at 4:28 PM Julien Tachoires wrote: > > > > > > When the content of a large transaction (size exceeding > > > logical_decoding_work_mem) and its sub-transactions has to be > > > re

Re: Compress ReorderBuffer spill files using LZ4

2024-06-06 Thread Julien Tachoires
Le jeu. 6 juin 2024 à 07:24, Alvaro Herrera a écrit : > > On 2024-Jun-06, Amit Kapila wrote: > > > On Thu, Jun 6, 2024 at 4:28 PM Julien Tachoires wrote: > > > > > > When the content of a large transaction (size exceeding > > > logical_decoding_work_mem) and its sub-transactions has to be > > > r

Re: Compress ReorderBuffer spill files using LZ4

2024-06-06 Thread Julien Tachoires
Le jeu. 6 juin 2024 à 06:40, Amit Kapila a écrit : > > On Thu, Jun 6, 2024 at 6:22 PM Julien Tachoires wrote: > > > > Le jeu. 6 juin 2024 à 04:13, Amit Kapila a écrit : > > > > > > On Thu, Jun 6, 2024 at 4:28 PM Julien Tachoires wrote: > > > > > > > > When the content of a large transaction (si

Re: Compress ReorderBuffer spill files using LZ4

2024-06-06 Thread Alvaro Herrera
On 2024-Jun-06, Amit Kapila wrote: > On Thu, Jun 6, 2024 at 4:28 PM Julien Tachoires wrote: > > > > When the content of a large transaction (size exceeding > > logical_decoding_work_mem) and its sub-transactions has to be > > reordered during logical decoding, then, all the changes are written >

Re: Compress ReorderBuffer spill files using LZ4

2024-06-06 Thread Amit Kapila
On Thu, Jun 6, 2024 at 6:22 PM Julien Tachoires wrote: > > Le jeu. 6 juin 2024 à 04:13, Amit Kapila a écrit : > > > > On Thu, Jun 6, 2024 at 4:28 PM Julien Tachoires wrote: > > > > > > When the content of a large transaction (size exceeding > > > logical_decoding_work_mem) and its sub-transactio

Re: Compress ReorderBuffer spill files using LZ4

2024-06-06 Thread Julien Tachoires
Le jeu. 6 juin 2024 à 04:13, Amit Kapila a écrit : > > On Thu, Jun 6, 2024 at 4:28 PM Julien Tachoires wrote: > > > > When the content of a large transaction (size exceeding > > logical_decoding_work_mem) and its sub-transactions has to be > > reordered during logical decoding, then, all the chan

Re: Compress ReorderBuffer spill files using LZ4

2024-06-06 Thread Dilip Kumar
On Thu, Jun 6, 2024 at 4:43 PM Amit Kapila wrote: > > On Thu, Jun 6, 2024 at 4:28 PM Julien Tachoires wrote: > > > > When the content of a large transaction (size exceeding > > logical_decoding_work_mem) and its sub-transactions has to be > > reordered during logical decoding, then, all the chang

Re: Compress ReorderBuffer spill files using LZ4

2024-06-06 Thread Amit Kapila
On Thu, Jun 6, 2024 at 4:28 PM Julien Tachoires wrote: > > When the content of a large transaction (size exceeding > logical_decoding_work_mem) and its sub-transactions has to be > reordered during logical decoding, then, all the changes are written > on disk in temporary files located in pg_repls

Compress ReorderBuffer spill files using LZ4

2024-06-06 Thread Julien Tachoires
we want a GUC to switch compression on/off? Regards, JT v1-0001-Compress-ReorderBuffer-spill-files-using-LZ4.patch Description: Binary data