Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
5ce851dc
Commit
5ce851dc
authored
Apr 05, 1999
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce default file size limit to 1Gb, and move the
configuration constant to config.h.
parent
9cae93d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
29 deletions
+23
-29
src/backend/storage/smgr/md.c
src/backend/storage/smgr/md.c
+6
-29
src/include/config.h.in
src/include/config.h.in
+17
-0
No files found.
src/backend/storage/smgr/md.c
View file @
5ce851dc
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.4
1 1999/02/13 23:18:35 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.4
2 1999/04/05 22:25:11 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -33,10 +33,11 @@
* The magnetic disk storage manager keeps track of open file descriptors
* in its own descriptor pool. This happens for two reasons. First, at
* transaction boundaries, we walk the list of descriptors and flush
* anything that we've dirtied in the current transaction. Second, we
* have to support relations of > 4GBytes. In order to do this, we break
* relations up into chunks of < 2GBytes and store one chunk in each of
* several files that represent the relation.
* anything that we've dirtied in the current transaction. Second, we want
* to support relations larger than the OS' file size limit (often 2GBytes).
* In order to do that, we break relations up into chunks of < 2GBytes
* and store one chunk in each of several files that represent the relation.
* See the BLCKSZ and RELSEG_SIZE configuration constants in include/config.h.
*/
typedef
struct
_MdfdVec
...
...
@@ -59,30 +60,6 @@ static MemoryContext MdCxt;
#define MDFD_DIRTY (uint16) 0x01
#define MDFD_FREE (uint16) 0x02
/*
* RELSEG_SIZE appears to be the number of segments that can
* be in a disk file. It was defined as 262144 based on 8k
* blocks, but now that the block size can be changed, this
* has to be calculated at compile time. Otherwise, the file
* size limit would not work out to 2-gig (2147483648).
*
* The number needs to be (2 ** 31) / BLCKSZ, but to be keep
* the math under MAXINT, pre-divide by 256 and use ...
*
* (((2 ** 23) / BLCKSZ) * (2 ** 8))
*
* 07 Jan 98 darrenk
*
* Now possibly let the OS handle it...
*
* 19 Mar 98 darrenk
*
*/
#ifndef LET_OS_MANAGE_FILESIZE
#define RELSEG_SIZE ((8388608 / BLCKSZ) * 256)
#endif
/* routines declared here */
static
MdfdVec
*
_mdfd_openseg
(
Relation
reln
,
int
segno
,
int
oflags
);
static
MdfdVec
*
_mdfd_getseg
(
Relation
reln
,
int
blkno
,
int
oflag
);
...
...
src/include/config.h.in
View file @
5ce851dc
...
...
@@ -27,6 +27,23 @@
*/
#define BLCKSZ 8192
/*
* RELSEG_SIZE is the maximum number of blocks allowed in one disk file.
* Thus, the maximum size of a single file is RELSEG_SIZE * BLCKSZ;
* relations bigger than that are divided into multiple files.
*
* CAUTION: RELSEG_SIZE * BLCKSZ must be less than your OS' limit on file size.
* This is typically 2Gb or 4Gb in a 32-bit operating system. By default,
* we make the limit one billion bytes to avoid any possible integer-overflow
* problems within the OS. A limit smaller than necessary only means we
* divide a large relation into more chunks than necessary, so it seems best
* to err in the direction of a small limit.
*
* CAUTION: you had best do an initdb if you change either BLCKSZ or
* RELSEG_SIZE.
*/
#define RELSEG_SIZE (1000000000 / BLCKSZ)
/*
* The following is set using configure.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment