Reduce the size of PageFreeSpaceInfo on 64bit platform

Поиск
Список
Период
Сортировка
От ITAGAKI Takahiro
Тема Reduce the size of PageFreeSpaceInfo on 64bit platform
Дата
Msg-id 20070810095003.754D.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
обсуждение исходный текст
Ответы Re: Reduce the size of PageFreeSpaceInfo on 64bit platform  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Reduce the size of PageFreeSpaceInfo on 64bit platform  (Decibel! <decibel@decibel.org>)
Список pgsql-patches
Here is a patch to reduce the size of PageFreeSpaceInfo on 64bit platform.
We will utilize maintenance_work_mem twice with the patch.

The sizeof(PageFreeSpaceInfo) is 16 bytes there because the type of 'avail'
is 'Size', that is typically 8 bytes and needs to be aligned in 8-byte bounds.
I changed the type of the field to uint32. We can store the freespace with
uint16 at smallest, but the alignment issue throws it away.

If we need to store freespace more compactly rather than calculation speed,
it might be good to use FSMPageData instead of PageFreeSpaceInfo, but I did
not change it in this patch.


Index: src/include/storage/freespace.h
===================================================================
--- src/include/storage/freespace.h    (head)
+++ src/include/storage/freespace.h    (fixed)
@@ -24,7 +24,7 @@
 typedef struct PageFreeSpaceInfo
 {
     BlockNumber blkno;            /* which page in relation */
-    Size        avail;            /* space available on this page */
+    uint32        avail;            /* space available on this page */
 } PageFreeSpaceInfo;


----

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Default location for docbook stylesheets in Gentoo
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Reduce the size of PageFreeSpaceInfo on 64bit platform