Re: pgstattuple: fix free space calculation

Поиск
Список
Период
Сортировка
От Andreas Karlsson
Тема Re: pgstattuple: fix free space calculation
Дата
Msg-id 76134d78-1c98-4815-8031-425a8358da84@proxel.se
обсуждение исходный текст
Ответ на Re: pgstattuple: fix free space calculation  (Rafia Sabih <rafia.pghackers@gmail.com>)
Список pgsql-hackers
On 8/23/24 12:02 PM, Rafia Sabih wrote:> On the other hand, this got me 
thinking about the purpose of this space > information.
> If we want to understand that there's still some space for the tuples in 
> a page, then using PageGetExactFreeSpace is not doing justice in case of 
> heap page, because we will not be able to add any more tuples there if 
> there are already MaxHeapTuplesPerPage tuples there.

I think the new behavior is the more useful one since what if someone 
wants to know the free space since they want to insert two tuples and 
not just one? I do not think the function should assume that the only 
reason someone would want to know the size is because they want to 
insert exactly one new tuple.

I am less certain about what the right behavior on pages where we are 
out of line pointers should be but I am leaning towards that the new 
behvior is better than the old but can see a case for either.

Tested the patch and it works as advertised.

Andreas




В списке pgsql-hackers по дате отправления: