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

Commit374bb5d

Browse files
committed
Some *very* major changes by darrenk@insightdist.com (Darren King)
==========================================What follows is a set of diffs that cleans up the usage of BLCKSZ.As a side effect, the person compiling the code can change thevalue of BLCKSZ _at_their_own_risk_. By that, I mean that I'vetried it here at 4096 and 16384 with no ill-effects. A valueof 4096 _shouldn't_ affect much as far as the kernel/file systemgoes, but making it bigger than 8192 can have severe consequencesif you don't know what you're doing. 16394 worked for me, _BUT_when I went to 32768 and did an initdb, the SCSI driver broke andthe partition that I was running under went to hell in a handbasket. Had to reboot and do a good bit of fsck'ing to fix things up.The patch can be safely applied though. Just leave BLCKSZ = 8192and everything is as before. It basically only cleans up all of thereferences to BLCKSZ in the code.If this patch is applied, a comment in the config.h file though abovethe BLCKSZ define with warning about monkeying around with it wouldbe a good idea.Darren darrenk@insightdist.com(Also cleans up some of the #includes in files referencing BLCKSZ.)==========================================
1 parentf0445dc commit374bb5d

File tree

15 files changed

+150
-161
lines changed

15 files changed

+150
-161
lines changed

‎src/backend/access/nbtree/nbtsort.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
*
77
* IDENTIFICATION
8-
* $Id: nbtsort.c,v 1.26 1998/01/07 21:01:59 momjian Exp $
8+
* $Id: nbtsort.c,v 1.27 1998/01/13 04:03:41 scrappy Exp $
99
*
1010
* NOTES
1111
*
@@ -49,13 +49,12 @@
4949

5050
#include<fcntl.h>
5151

52-
#include<postgres.h>
53-
54-
#include<utils/memutils.h>
55-
#include<storage/bufpage.h>
56-
#include<access/nbtree.h>
57-
#include<storage/bufmgr.h>
52+
#include"postgres.h"
5853

54+
#include"access/nbtree.h"
55+
#include"storage/bufmgr.h"
56+
#include"storage/bufpage.h"
57+
#include"utils/memutils.h"
5958

6059
#ifndefHAVE_MEMMOVE
6160
#include<regex/utils.h>
@@ -64,7 +63,7 @@
6463
#endif
6564

6665
#ifdefBTREE_BUILD_STATS
67-
#include<tcop/tcopprot.h>
66+
#include"tcop/tcopprot.h"
6867
externintShowExecutorStats;
6968

7069
#endif
@@ -85,7 +84,7 @@ static void _bt_uppershutdown(Relation index, BTPageState *state);
8584
#defineFASTBUILD_MERGE
8685

8786
#defineMAXTAPES(7)
88-
#defineTAPEBLCKSZ(MAXBLCKSZ << 2)
87+
#defineTAPEBLCKSZ(BLCKSZ << 2)
8988
#defineTAPETEMP"pg_btsortXXXXXX"
9089

9190
externintNDirectFileRead;
@@ -458,7 +457,7 @@ _bt_tapewrite(BTTapeBlock *tape, int eor)
458457
{
459458
tape->bttb_eor=eor;
460459
FileWrite(tape->bttb_fd, (char*)tape,TAPEBLCKSZ);
461-
NDirectFileWrite+=TAPEBLCKSZ /MAXBLCKSZ;
460+
NDirectFileWrite+=TAPEBLCKSZ /BLCKSZ;
462461
_bt_tapereset(tape);
463462
}
464463

@@ -496,7 +495,7 @@ _bt_taperead(BTTapeBlock *tape)
496495
return (0);
497496
}
498497
Assert(tape->bttb_magic==BTTAPEMAGIC);
499-
NDirectFileRead+=TAPEBLCKSZ /MAXBLCKSZ;
498+
NDirectFileRead+=TAPEBLCKSZ /BLCKSZ;
500499
return (1);
501500
}
502501

‎src/backend/catalog/index.c

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.33 1998/01/06 19:42:29 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.34 1998/01/13 04:03:45 scrappy Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -23,34 +23,33 @@
2323
*
2424
*-------------------------------------------------------------------------
2525
*/
26-
#include<postgres.h>
27-
28-
#include<catalog/pg_proc.h>
29-
#include<storage/bufmgr.h>
30-
#include<fmgr.h>
31-
#include<access/genam.h>
32-
#include<access/heapam.h>
33-
#include<access/istrat.h>
34-
#include<access/xact.h>
35-
#include<bootstrap/bootstrap.h>
36-
#include<catalog/catname.h>
37-
#include<catalog/catalog.h>
38-
#include<catalog/indexing.h>
39-
#include<catalog/heap.h>
40-
#include<catalog/index.h>
41-
#include<catalog/pg_type.h>
42-
#include<executor/executor.h>
43-
#include<miscadmin.h>
44-
#include<optimizer/clauses.h>
45-
#include<optimizer/prep.h>
46-
#include<parser/parse_func.h>
47-
#include<storage/lmgr.h>
48-
#include<storage/smgr.h>
49-
#include<utils/builtins.h>
50-
#include<utils/mcxt.h>
51-
#include<utils/relcache.h>
52-
#include<utils/syscache.h>
53-
#include<utils/tqual.h>
26+
#include"postgres.h"
27+
#include"fmgr.h"
28+
29+
#include"access/genam.h"
30+
#include"access/heapam.h"
31+
#include"access/istrat.h"
32+
#include"access/xact.h"
33+
#include"bootstrap/bootstrap.h"
34+
#include"catalog/catalog.h"
35+
#include"catalog/catname.h"
36+
#include"catalog/heap.h"
37+
#include"catalog/index.h"
38+
#include"catalog/indexing.h"
39+
#include"catalog/pg_proc.h"
40+
#include"catalog/pg_type.h"
41+
#include"executor/executor.h"
42+
#include"miscadmin.h"
43+
#include"optimizer/clauses.h"
44+
#include"optimizer/prep.h"
45+
#include"parser/parse_func.h"
46+
#include"storage/lmgr.h"
47+
#include"storage/smgr.h"
48+
#include"utils/builtins.h"
49+
#include"utils/mcxt.h"
50+
#include"utils/relcache.h"
51+
#include"utils/syscache.h"
52+
#include"utils/tqual.h"
5453

5554
#ifndefHAVE_MEMMOVE
5655
#include<regex/utils.h>

‎src/backend/executor/nodeHash.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.15 1998/01/07 21:02:52 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.16 1998/01/13 04:03:53 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -31,15 +31,11 @@
3131

3232
#include"postgres.h"
3333

34-
35-
#include"storage/fd.h"/* for SEEK_ */
36-
#include"storage/ipc.h"
37-
#include"storage/bufmgr.h"/* for BLCKSZ */
34+
#include"executor/execdebug.h"
3835
#include"executor/executor.h"
3936
#include"executor/nodeHash.h"
4037
#include"executor/nodeHashjoin.h"
41-
#include"executor/execdebug.h"
42-
#include"utils/palloc.h"
38+
#include"storage/ipc.h"
4339
#include"utils/hsearch.h"
4440

4541
externintNBuffers;

‎src/backend/executor/nodeHashjoin.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.8 1997/09/08 21:43:12 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.9 1998/01/13 04:03:58 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -17,21 +17,14 @@
1717
#include<sys/stat.h>
1818
#include<fcntl.h>
1919

20-
21-
2220
#include"postgres.h"
23-
#include"storage/bufmgr.h"/* for BLCKSZ */
24-
#include"storage/fd.h"/* for SEEK_ */
25-
#include"executor/executor.h"
21+
2622
#include"executor/execdebug.h"
23+
#include"executor/executor.h"
2724
#include"executor/nodeHash.h"
2825
#include"executor/nodeHashjoin.h"
29-
3026
#include"optimizer/clauses.h"/* for get_leftop */
3127

32-
33-
#include"utils/palloc.h"
34-
3528
staticTupleTableSlot*
3629
ExecHashJoinOuterGetTuple(Plan*node,Plan*parent,HashJoinState*hjstate);
3730

‎src/backend/optimizer/path/costsize.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.19 1997/09/08 21:44:50 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.20 1998/01/13 04:04:06 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414

1515
#include"postgres.h"
16-
#include"config.h"
1716

1817
#include<math.h>
18+
1919
#ifdefHAVE_LIMITS_H
2020
#include<limits.h>
2121
#ifndefMAXINT
@@ -27,15 +27,12 @@
2727
#endif
2828
#endif
2929

30-
#include<utils/lsyscache.h>
3130
#include"nodes/relation.h"
32-
3331
#include"optimizer/cost.h"
3432
#include"optimizer/internal.h"
3533
#include"optimizer/keys.h"
3634
#include"optimizer/tlist.h"
37-
38-
#include"storage/bufmgr.h"/* for BLCKSZ */
35+
#include"utils/lsyscache.h"
3936

4037
externintNBuffers;
4138

‎src/backend/optimizer/path/xfunc.c

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.11 1998/01/07 21:03:56 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.12 1998/01/13 04:04:07 scrappy Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -19,29 +19,26 @@
1919
#include<string.h>
2020

2121
#include"postgres.h"
22-
#include"nodes/pg_list.h"
22+
23+
#include"access/heapam.h"
24+
#include"catalog/pg_language.h"
25+
#include"catalog/pg_proc.h"
26+
#include"catalog/pg_type.h"
27+
#include"lib/lispsort.h"
2328
#include"nodes/nodes.h"
29+
#include"nodes/pg_list.h"
2430
#include"nodes/primnodes.h"
2531
#include"nodes/relation.h"
26-
#include"utils/elog.h"
27-
#include"utils/palloc.h"
28-
#include"utils/syscache.h"
29-
#include"catalog/pg_proc.h"
30-
#include"catalog/pg_type.h"
31-
#include"utils/syscache.h"
32-
#include"catalog/pg_language.h"
33-
#include"optimizer/xfunc.h"
3432
#include"optimizer/clauses.h"
35-
#include"optimizer/pathnode.h"
36-
#include"optimizer/internal.h"
3733
#include"optimizer/cost.h"
34+
#include"optimizer/internal.h"
3835
#include"optimizer/keys.h"
39-
#include"optimizer/tlist.h"
40-
#include"lib/lispsort.h"
41-
#include"access/heapam.h"
42-
#include"tcop/dest.h"
36+
#include"optimizer/pathnode.h"
37+
#include"optimizer/tlist.h"/* for get_expr */
38+
#include"optimizer/xfunc.h"
4339
#include"storage/buf_internals.h"/* for NBuffers */
44-
#include"optimizer/tlist.h"/* for get_expr */
40+
#include"tcop/dest.h"
41+
#include"utils/syscache.h"
4542

4643
#defineever ; 1 ;
4744

‎src/backend/rewrite/rewriteDefine.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,28 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.13 1998/01/07 21:04:32 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.14 1998/01/13 04:04:12 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#include<stdio.h>
1515
#include<string.h>
16+
1617
#include"postgres.h"
1718

18-
#include"utils/rel.h"/* for Relation stuff */
1919
#include"access/heapam.h"/* access methods like amopenr */
20-
#include"utils/builtins.h"
21-
#include"utils/elog.h"/* for elog */
22-
#include"utils/palloc.h"
23-
#include"utils/lsyscache.h"/* for get_typlen */
24-
#include"nodes/pg_list.h"/* for Lisp support */
2520
#include"nodes/parsenodes.h"
21+
#include"nodes/pg_list.h"/* for Lisp support */
2622
#include"parser/parse_relation.h"
27-
2823
#include"rewrite/locks.h"
2924
#include"rewrite/rewriteDefine.h"
3025
#include"rewrite/rewriteRemove.h"
3126
#include"rewrite/rewriteSupport.h"
3227
#include"tcop/tcopprot.h"
28+
#include"utils/builtins.h"
29+
#include"utils/lsyscache.h"/* for get_typlen */
30+
#include"utils/rel.h"/* for Relation stuff */
31+
3332

3433
OidLastOidProcessed=InvalidOid;
3534

@@ -39,7 +38,7 @@ OidLastOidProcessed = InvalidOid;
3938
*
4039
* should this be smaller?
4140
*/
42-
#defineRULE_PLAN_SIZE8192
41+
#defineRULE_PLAN_SIZEBLCKSZ
4342

4443
staticvoid
4544
strcpyq(char*dest,char*source)

‎src/backend/storage/buffer/localbuf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.16 1998/01/07 21:04:54 momjian Exp $
18+
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.17 1998/01/13 04:04:20 scrappy Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -39,7 +39,6 @@
3939
#include"storage/spin.h"
4040
#include"storage/smgr.h"
4141
#include"storage/lmgr.h"
42-
#include"storage/buf_internals.h"
4342
#include"miscadmin.h"
4443
#include"utils/builtins.h"
4544
#include"utils/hsearch.h"

‎src/backend/storage/smgr/md.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.26 1998/01/07 21:05:44 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.27 1998/01/13 04:04:31 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -20,14 +20,12 @@
2020
#include"postgres.h"
2121
#include"miscadmin.h"/* for DataDir */
2222

23+
#include"catalog/catalog.h"
2324
#include"storage/block.h"
2425
#include"storage/fd.h"
2526
#include"storage/smgr.h"/* where the declarations go */
26-
#include"storage/fd.h"
2727
#include"utils/mcxt.h"
2828
#include"utils/rel.h"
29-
#include"utils/palloc.h"
30-
#include"catalog/catalog.h"
3129

3230
#undef DIAGNOSTIC
3331

@@ -59,7 +57,22 @@ static MemoryContext MdCxt;
5957
#defineMDFD_DIRTY(uint16) 0x01
6058
#defineMDFD_FREE(uint16) 0x02
6159

62-
#defineRELSEG_SIZE262144/* (2 ** 31) / 8192 -- 2GB file */
60+
/*
61+
* RELSEG_SIZE appears to be the number of segments that can
62+
* be in a disk file. It was defined as 262144 based on 8k
63+
* blocks, but now that the block size can be changed, this
64+
* has to be calculated at compile time. Otherwise, the file
65+
* size limit would not work out to 2-gig (2147483648).
66+
*
67+
* The number needs to be (2 ** 31) / BLCKSZ, but to be keep
68+
* the math under MAXINT, pre-divide by 256 and use ...
69+
*
70+
* (((2 ** 23) / BLCKSZ) * (2 ** 8))
71+
*
72+
* 07 Jan 98 darrenk
73+
*/
74+
75+
#defineRELSEG_SIZE((8388608 / BLCKSZ) * 256)
6376

6477
/* routines declared here */
6578
staticMdfdVec*_mdfd_openseg(Relationreln,intsegno,intoflags);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp