|
8 | 8 | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
9 | 9 | * Portions Copyright (c) 1994, Regents of the University of California
|
10 | 10 | *
|
11 |
| - * $Id: large_object.h,v 1.18 2000/10/24 01:38:43 tgl Exp $ |
| 11 | + * $Id: large_object.h,v 1.19 2000/10/24 03:34:53 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -47,13 +47,18 @@ typedef struct LargeObjectDesc {
|
47 | 47 | /*
|
48 | 48 | * Each "page" (tuple) of a large object can hold this much data
|
49 | 49 | *
|
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. |
53 | 60 | */
|
54 |
| -#define LOBLKSIZE (MaxTupleSize \ |
55 |
| - - MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) \ |
56 |
| - - sizeof(Oid) - sizeof(int32) * 2) |
| 61 | +#define LOBLKSIZE (BLCKSZ / 4) |
57 | 62 |
|
58 | 63 |
|
59 | 64 | /*
|
|
0 commit comments