aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/nbtree/nbtsort.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/nbtree/nbtsort.c')
-rw-r--r--src/backend/access/nbtree/nbtsort.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c
index 3c091759497..54899c016a9 100644
--- a/src/backend/access/nbtree/nbtsort.c
+++ b/src/backend/access/nbtree/nbtsort.c
@@ -5,7 +5,7 @@
*
*
* IDENTIFICATION
- * $Id: nbtsort.c,v 1.40 1999/05/25 18:20:31 vadim Exp $
+ * $Id: nbtsort.c,v 1.40.2.1 1999/08/02 05:24:41 scrappy Exp $
*
* NOTES
*
@@ -52,18 +52,9 @@
#include "postgres.h"
#include "access/nbtree.h"
-#include "storage/bufpage.h"
-#include "utils/memutils.h"
-#ifndef HAVE_MEMMOVE
-#include <regex/utils.h>
-#else
-#include <string.h>
-#endif
#ifdef BTREE_BUILD_STATS
-#include "tcop/tcopprot.h"
-#include <utils/trace.h>
#define ShowExecutorStats pg_options[TRACE_EXECUTORSTATS]
#endif
@@ -95,7 +86,7 @@ extern int NDirectFileWrite;
* are potentially reading a bunch of zeroes off of disk in many
* cases.
*
- * BTItems are packed in and DOUBLEALIGN'd.
+ * BTItems are packed in and MAXALIGN'd.
*
* the fd should not be going out to disk, strictly speaking, but it's
* the only thing like that so i'm not going to worry about wasting a
@@ -506,7 +497,7 @@ _bt_tapenext(BTTapeBlock *tape, char **pos)
return (BTItem) NULL;
bti = (BTItem) *pos;
itemsz = BTITEMSZ(bti);
- *pos += DOUBLEALIGN(itemsz);
+ *pos += MAXALIGN(itemsz);
return bti;
}
@@ -526,7 +517,7 @@ _bt_tapeadd(BTTapeBlock *tape, BTItem item, int itemsz)
{
memcpy(tape->bttb_data + tape->bttb_top, item, itemsz);
++tape->bttb_ntup;
- tape->bttb_top += DOUBLEALIGN(itemsz);
+ tape->bttb_top += MAXALIGN(itemsz);
}
/*-------------------------------------------------------------------------
@@ -662,7 +653,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
itape = btspool->bts_itape[btspool->bts_tape];
itemsz = BTITEMSZ(btitem);
- itemsz = DOUBLEALIGN(itemsz);
+ itemsz = MAXALIGN(itemsz);
/*
* if this buffer is too full for this BTItemData, or if we have run
@@ -702,7 +693,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
* BTItemDatas in the order dictated by the sorted array of
* BTItems, not the original order.
*
- * (since everything was DOUBLEALIGN'd and is all on a single tape
+ * (since everything was MAXALIGN'd and is all on a single tape
* block, everything had *better* still fit on one tape block..)
*/
otape = btspool->bts_otape[btspool->bts_tape];
@@ -710,7 +701,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
{
bti = parray[i].btsk_item;
btisz = BTITEMSZ(bti);
- btisz = DOUBLEALIGN(btisz);
+ btisz = MAXALIGN(btisz);
_bt_tapeadd(otape, bti, btisz);
#if defined(FASTBUILD_DEBUG) && defined(FASTBUILD_SPOOL)
{
@@ -912,7 +903,7 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags)
pgspc = PageGetFreeSpace(npage);
btisz = BTITEMSZ(bti);
- btisz = DOUBLEALIGN(btisz);
+ btisz = MAXALIGN(btisz);
if (pgspc < btisz)
{
Buffer obuf = nbuf;
@@ -1230,7 +1221,7 @@ _bt_merge(Relation index, BTSpool *btspool)
if (bti != (BTItem) NULL)
{
btisz = BTITEMSZ(bti);
- btisz = DOUBLEALIGN(btisz);
+ btisz = MAXALIGN(btisz);
if (doleaf)
{
_bt_buildadd(index, state, bti, BTP_LEAF);