Re: TOAST usage setting - Mailing list pgsql-hackers
From | Bruce Momjian |
---|---|
Subject | Re: TOAST usage setting |
Date | |
Msg-id | 200706060327.l563RPW25007@momjian.us Whole thread Raw |
In response to | Re: TOAST usage setting ("Zeugswetter Andreas ADI SD" <ZeugswetterA@spardat.at>) |
Responses |
Re: TOAST usage setting
|
List | pgsql-hackers |
Zeugswetter Andreas ADI SD wrote: > > > > The big question is do we want to drop the target tuple size down > to > > > 512, and increase the chunk size to 8k for 8.3? Dropping the tuple > > > size down to 512 is going to give us some smaller TOAST values to > fill > > > in free space created by the 8k chuck size, assuming you have both > > > types of values in the table. Do we want to increase the access > time > > > of long TOAST by 6% if it means having more wasted space for lots of > > > > 4.1k values? > > > > If we do that people could see their disk space usage increase by up > to > > 16x: currently 513 bytes fits in heap and takes (roughly) 513 > > bytes; > > No, you misunderstood. Bruce was suggesting changing the target to 512. > That means if a row is wider than ~2k, toaster will try to toast until > the base row is > ~512 bytes. I would not do that part for 8.3. OK, what do you suggest for 8.3? Attached are my suggestion to use 512 and a 4k chunk size, which I think means that 2.7k is the worst values that has a loss of around 25%. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + Index: src/include/access/tuptoaster.h =================================================================== RCS file: /cvsroot/pgsql/src/include/access/tuptoaster.h,v retrieving revision 1.35 diff -c -c -r1.35 tuptoaster.h *** src/include/access/tuptoaster.h 6 Apr 2007 04:21:43 -0000 1.35 --- src/include/access/tuptoaster.h 2 Jun 2007 02:52:22 -0000 *************** *** 42,48 **** * given to needs_toast_table() in toasting.c before unleashing random * changes. */ ! #define TOAST_TUPLES_PER_PAGE 4 /* Note: sizeof(PageHeaderData) includes the first ItemId on the page */ #define TOAST_TUPLE_THRESHOLD \ --- 42,48 ---- * given to needs_toast_table() in toasting.c before unleashing random * changes. */ ! #define TOAST_TUPLES_PER_PAGE 16 /* Note: sizeof(PageHeaderData) includes the first ItemId on the page */ #define TOAST_TUPLE_THRESHOLD \ *************** *** 69,75 **** * * NB: Changing TOAST_MAX_CHUNK_SIZE requires an initdb. */ ! #define EXTERN_TUPLES_PER_PAGE 4 /* tweak only this */ /* Note: sizeof(PageHeaderData) includes the first ItemId on the page */ #define EXTERN_TUPLE_MAX_SIZE \ --- 69,75 ---- * * NB: Changing TOAST_MAX_CHUNK_SIZE requires an initdb. */ ! #define EXTERN_TUPLES_PER_PAGE 2 /* tweak only this */ /* Note: sizeof(PageHeaderData) includes the first ItemId on the page */ #define EXTERN_TUPLE_MAX_SIZE \
pgsql-hackers by date: