Re: Add a property to automatically suspend portals as they produce given number of bytes - Mailing list pgsql-hackers

From Vladimir Sitnikov
Subject Re: Add a property to automatically suspend portals as they produce given number of bytes
Date
Msg-id CAB=Je-HcnC=e80gFQdj1bMsA9v31xcsY-tT=JGuoJtFMOxbfXg@mail.gmail.com
Whole thread Raw
In response to Re: Add a property to automatically suspend portals as they produce given number of bytes  (Kirill Reshke <reshkekirill@gmail.com>)
List pgsql-hackers
Kirill,

cursor does not provide a way to limit the fetch size based on the memory consumption.
Imagine a table like (id int8, value jsonb).
If we use "fetch 1000", then it might require 1GiB on the client if every row contains 1MiB json.
If the client plays defensively and goes for "fetch 10", it might take a lot of time if jsons are small.

Neither cursor nor extended protocol solve the problem.

Vladimir

pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Eager aggregation, take 3
Next
From: Shlok Kyal
Date:
Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation