mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
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 the value of BLCKSZ _at_their_own_risk_. By that, I mean that I've tried it here at 4096 and 16384 with no ill-effects. A value of 4096 _shouldn't_ affect much as far as the kernel/file system goes, but making it bigger than 8192 can have severe consequences if 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 and the partition that I was running under went to hell in a hand basket. 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 = 8192 and everything is as before. It basically only cleans up all of the references to BLCKSZ in the code. If this patch is applied, a comment in the config.h file though above the BLCKSZ define with warning about monkeying around with it would be a good idea. Darren darrenk@insightdist.com (Also cleans up some of the #includes in files referencing BLCKSZ.) ==========================================
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.30 1998/01/07 21:06:39 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.31 1998/01/13 04:04:57 scrappy Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Sorts the first relation into the second relation.
|
||||
@ -40,27 +40,22 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "postgres.h"
|
||||
#include "miscadmin.h"
|
||||
|
||||
#include "executor/execdebug.h"
|
||||
#include "access/heapam.h"
|
||||
#include "access/htup.h"
|
||||
#include "access/relscan.h"
|
||||
#include "access/skey.h"
|
||||
#include "storage/buf.h"
|
||||
#include "storage/bufmgr.h" /* for BLCKSZ */
|
||||
#include "utils/portal.h" /* for {Start,End}PortalAllocMode */
|
||||
#include "utils/elog.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
#include "executor/execdebug.h"
|
||||
#include "executor/executor.h"
|
||||
#include "nodes/execnodes.h"
|
||||
#include "nodes/plannodes.h"
|
||||
#include "executor/executor.h"
|
||||
|
||||
#include "utils/lselect.h"
|
||||
#include "utils/psort.h"
|
||||
|
||||
#include "miscadmin.h"
|
||||
#include "storage/buf.h"
|
||||
#include "storage/fd.h"
|
||||
#include "utils/lselect.h"
|
||||
#include "utils/portal.h" /* for {Start,End}PortalAllocMode */
|
||||
#include "utils/psort.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
static bool createfirstrun(Sort * node);
|
||||
static bool createrun(Sort * node, FILE * file);
|
||||
@ -250,7 +245,7 @@ inittapes(Sort * node)
|
||||
|
||||
#define USEMEM(NODE,AMT) PS(node)->treeContext.sortMem -= (AMT)
|
||||
#define FREEMEM(NODE,AMT) PS(node)->treeContext.sortMem += (AMT)
|
||||
#define LACKMEM(NODE) (PS(node)->treeContext.sortMem <= MAXBLCKSZ) /* not accurate */
|
||||
#define LACKMEM(NODE) (PS(node)->treeContext.sortMem <= BLCKSZ) /* not accurate */
|
||||
#define TRACEMEM(FUNC)
|
||||
#define TRACEOUT(FUNC, TUP)
|
||||
|
||||
|
Reference in New Issue
Block a user