Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita9b6b01

Browse files
committed
Reconsider page size for large objects: rather than stuffing disk pages
as full as possible, seems better to use a tuple size around BLCKSZ/4so that less space is wasted when a LO tuple is updated. Also, thislets us use a logical page size that's an exact power of two, avoidingpartial-page writes when client is sending us stuff in power-of-2buffer chunks.
1 parent711c9f3 commita9b6b01

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

‎src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $Id: catversion.h,v 1.52 2000/10/2401:38:41 tgl Exp $
40+
* $Id: catversion.h,v 1.53 2000/10/2403:34:15 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200010232
56+
#defineCATALOG_VERSION_NO200010233
5757

5858
#endif

‎src/include/storage/large_object.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: large_object.h,v 1.18 2000/10/2401:38:43 tgl Exp $
11+
* $Id: large_object.h,v 1.19 2000/10/2403:34:53 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -47,13 +47,18 @@ typedef struct LargeObjectDesc {
4747
/*
4848
* Each "page" (tuple) of a large object can hold this much data
4949
*
50-
* Calculation is max tuple size less tuple header, loid field (Oid),
51-
* pageno field (int32), and varlena header of data (int32). Note we
52-
* assume none of the fields will be NULL, hence no need for null bitmap.
50+
* We could set this as high as BLCKSZ less some overhead, but it seems
51+
* better to make it a smaller value, so that not as much space is used
52+
* up when a page-tuple is updated. Note that the value is deliberately
53+
* chosen large enough to trigger the tuple toaster, so that we will
54+
* attempt to compress page tuples in-line. (But they won't be moved off
55+
* unless the user creates a toast-table for pg_largeobject...)
56+
*
57+
* Also, it seems to be a smart move to make the page size be a power of 2,
58+
* since clients will often be written to send data in power-of-2 blocks.
59+
* This avoids unnecessary tuple updates caused by partial-page writes.
5360
*/
54-
#defineLOBLKSIZE(MaxTupleSize \
55-
- MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) \
56-
- sizeof(Oid) - sizeof(int32) * 2)
61+
#defineLOBLKSIZE(BLCKSZ / 4)
5762

5863

5964
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp