Re: Proposal: Adding compression of temporary files
От | Alexander Korotkov |
---|---|
Тема | Re: Proposal: Adding compression of temporary files |
Дата | |
Msg-id | CAPpHfdsw0hK2ioSZxOfR_nQ8hnE1ybg0XqZgzW1kyNxOvsj6JQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Proposal: Adding compression of temporary files (Tomas Vondra <tomas@vondra.me>) |
Список | pgsql-hackers |
On Tue, Mar 18, 2025 at 12:13 AM Tomas Vondra <tomas@vondra.me> wrote: > On 3/15/25 11:40, Alexander Korotkov wrote: > > On Sun, Jan 5, 2025 at 1:43 AM Filip Janus <fjanus@redhat.com> wrote: > >> > >> I apologize for multiple messages, but I found a small bug in the previous version. > >> > >> -Filip- > > > > Great, thank you for your work. > > > > I think the patches could use a pgindent run. > > > > I don't see a reason why the temp file compression method should be > > different from the wal compression methods, which we already have > > in-tree. Perhaps it would be nice to have a 0001 patch, which would > > abstract the compression methods we now have for wal into a separate > > file containing GUC option values and functions for > > compress/decompress. Then, 0002 would apply this to temporary file > > compression. > > > > Not sure I understand the design you're proposing ... > > AFAIK the WAL compression is not compressing the file data directly, > it's compressing backup blocks one by one, which then get written to WAL > as one piece of a record. So it's dealing with individual blocks, not > files, and we already have API to compress blocks (well, it's pretty > much the APIs for each compression method). > > You're proposing abstracting that into a separate file - what would be > in that file? How would you abstract this to make it also useful for > file compression? > > I can imagine a function CompressBufffer(method, dst, src, ...) wrapping > the various compression methods, unifying the error handling, etc. I can > imagine that, but that API is also limiting - e.g. how would that work > with stream compression, which seems irrelevant for WAL, but might be > very useful for tempfile compression. Yes, I was thinking about some generic API that provides a safe way to compress some data chunk with given compression method. It seems that yet it should suit both WAL, toast and temp files in the current implementation. But, yes, if we would implement streaming compression in future that would require another API. ------ Regards, Alexander Korotkov Supabase
В списке pgsql-hackers по дате отправления: