diff options
| author | Vadim B. Mikheev | 1999-03-28 20:32:42 +0000 |
|---|---|---|
| committer | Vadim B. Mikheev | 1999-03-28 20:32:42 +0000 |
| commit | fdf6be80f993d2908f794c0a33aedff479a92813 (patch) | |
| tree | 01e6047f38baeb4124c6c331de8ed81862647353 /src/include | |
| parent | d4ed17842a44853ce339b80e111ec1bc58691c17 (diff) | |
1. Vacuum is updated for MVCC.
2. Much faster btree tuples deletion in the case when first on page
index tuple is deleted (no movement to the left page(s)).
3. Remember blkno of new root page in BTPageOpaque of
left/right siblings when root page is splitted.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/htup.h | 7 | ||||
| -rw-r--r-- | src/include/access/nbtree.h | 12 | ||||
| -rw-r--r-- | src/include/commands/vacuum.h | 37 |
3 files changed, 36 insertions, 20 deletions
diff --git a/src/include/access/htup.h b/src/include/access/htup.h index f344f195da2..5e748f4fcf9 100644 --- a/src/include/access/htup.h +++ b/src/include/access/htup.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: htup.h,v 1.13 1999/02/13 23:20:54 momjian Exp $ + * $Id: htup.h,v 1.14 1999/03/28 20:32:30 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -117,8 +117,11 @@ typedef HeapTupleData *HeapTuple; #define HEAP_XMAX_COMMITTED 0x0400 /* t_xmax committed */ #define HEAP_XMAX_INVALID 0x0800 /* t_xmax invalid/aborted */ #define HEAP_MARKED_FOR_UPDATE 0x1000 /* marked for UPDATE */ +#define HEAP_UPDATED 0x2000 /* this is UPDATEd version of row */ +#define HEAP_MOVED_OFF 0x4000 /* removed or moved to another place by vacuum */ +#define HEAP_MOVED_IN 0x8000 /* moved from another place by vacuum */ -#define HEAP_XACT_MASK 0x0F00 /* */ +#define HEAP_XACT_MASK 0xFF00 /* */ #define HeapTupleNoNulls(tuple) \ (!(((HeapTuple) (tuple))->t_data->t_infomask & HEAP_HASNULL)) diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h index fedd539e5dc..b1c54366d88 100644 --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: nbtree.h,v 1.23 1999/02/13 23:20:55 momjian Exp $ + * $Id: nbtree.h,v 1.24 1999/03/28 20:32:34 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -42,6 +42,7 @@ typedef struct BTPageOpaqueData { BlockNumber btpo_prev; BlockNumber btpo_next; + BlockNumber btpo_parent; uint16 btpo_flags; #define BTP_LEAF (1 << 0) @@ -177,13 +178,6 @@ typedef struct BTPageState #define BT_DESCENT 1 /* - * We must classify index modification types for the benefit of - * _bt_adjscans. - */ -#define BT_INSERT 0 -#define BT_DELETE 1 - -/* * In general, the btree code tries to localize its knowledge about * page layout to a couple of routines. However, we need a special * value to indicate "no page number" in those places where we expect @@ -268,7 +262,7 @@ extern void btdelete(Relation rel, ItemPointer tid); */ extern void _bt_regscan(IndexScanDesc scan); extern void _bt_dropscan(IndexScanDesc scan); -extern void _bt_adjscans(Relation rel, ItemPointer tid, int op); +extern void _bt_adjscans(Relation rel, ItemPointer tid); /* * prototypes for functions in nbtsearch.c diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h index 0e21a8b8307..3b76f3da356 100644 --- a/src/include/commands/vacuum.h +++ b/src/include/commands/vacuum.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: vacuum.h,v 1.17 1999/02/13 23:21:20 momjian Exp $ + * $Id: vacuum.h,v 1.18 1999/03/28 20:32:38 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -95,16 +95,35 @@ typedef struct VRelListData typedef VRelListData *VRelList; +typedef struct VTupleLinkData +{ + ItemPointerData new_tid; + ItemPointerData this_tid; +} VTupleLinkData; + +typedef VTupleLinkData *VTupleLink; + +typedef struct VTupleMoveData +{ + ItemPointerData tid; /* tuple ID */ + VPageDescr vpd; /* where to move */ + bool cleanVpd; /* clean vpd before using */ +} VTupleMoveData; + +typedef VTupleMoveData *VTupleMove; + typedef struct VRelStats { - Oid relid; - int num_tuples; - int num_pages; - Size min_tlen; - Size max_tlen; - bool hasindex; - int va_natts; /* number of attrs being analyzed */ - VacAttrStats *vacattrstats; + Oid relid; + int num_tuples; + int num_pages; + Size min_tlen; + Size max_tlen; + bool hasindex; + int va_natts; /* number of attrs being analyzed */ + VacAttrStats *vacattrstats; + int num_vtlinks; + VTupleLink vtlinks; } VRelStats; extern bool VacuumRunning; |
