head     1.6;
branch   ;
access   ;
symbols  Version_2_1:1.6 Version_2:1.5 C_Demo_1:1.4;
locks    ; strict;
comment  @ * @;


1.6
date     90.08.17.08.50.47;  author cimarron;  state Exp;
branches ;
next     1.5;

1.5
date     90.06.08.15.27.49;  author cimarron;  state Version_2;
branches ;
next     1.4;

1.4
date     89.09.05.17.06.40;  author mao;  state C_Demo_1;
branches ;
next     1.3;

1.3
date     89.04.12.19.54.18;  author dillon;  state Exp;
branches ;
next     1.2;

1.2
date     89.02.02.18.01.53;  author aoki;  state Stab;
branches ;
next     1.1;

1.1
date     89.01.17.05.54.09;  author cimarron;  state Exp;
branches ;
next     ;


desc
@@


1.6
log
@added pathnames to #include statements
@
text
@/*
 * hrnd.h --
 *	POSTGRES heap access method randomization definitions.
 *
 * Note:
 *	XXX This file should be moved to heap/.
 *
 * Identification:
 *	$Header: RCS/hrnd.h,v 1.5 90/06/08 15:27:49 cimarron Version_2 Locker: cimarron $
 */

#ifndef	HRndIncluded	/* Include this file only once */
#define HRndIncluded	1

#include "tmp/postgres.h"

#include "storage/block.h"
#include "utils/rel.h"

typedef BlockNumber	*BlockIndexList;

/* XXX The following values are *not* tuned in any way */

#define MaxLengthOfBlockIndexList	3

#define FillLimitBase		16
#define OneBlockFillLimit	(FillLimitBase * 3/8)
#define TwoBlockFillLimit	(FillLimitBase * 1/4)
#define ThreeBlockFillLimit	(FillLimitBase * 3/16)
#define ManyBlockFillLimit	(FillLimitBase * 1/8)
#define ClusteredBlockFillLimit	(FillLimitBase * 1/16)

#define ClusteredNumberOfFailures	(1 + MaxLengthOfBlockIndexList)

#define FillLimitAdjustment(failures)\
	((failures >= MaxLengthOfBlockIndexList) ? 0 :\
		(FillLimitBase * (MaxLengthOfBlockIndexList - failures - 1)/16))
/*
 * InitRandom --
 *	Initializes randomization support.
 */
extern
void
InitRandom ARGS((
	void
));

/*
 * getclusteredappend --
 *	Returns block index to use for clustering.
 *
 * Note:
 *	This is a hack utill clustering is supported correctly.
 */
extern
BlockNumber
getclusteredappend ARGS((
	void
));

/*
 * setclusterblockindex --
 *	Causes append clustering on indicated block if enabled.
 *
 * Note:
 *	This is a hack utill clustering is supported correctly.
 */
extern
void
setclusterblockindex ARGS((
	BlockNumber	blockIndex
));

/*
 * setclusterblockindex --
 *	Causes append clustering on indicated block if enabled.
 *
 * Note:
 *	This is a hack utill clustering is supported correctly.
 */
extern
void
setclusterblockindex ARGS((
	BlockNumber	blockIndex
));

/*
 * RelationContainsUsableBlock --
 *	True iff free space in a block of relation is sufficient to hold tuple.
 *
 * Note:
 *	Assumes relation is valid and is not physically empty.
 *	Assumes block index is in valid range.
 *	Assumes tuple size is valid.
 */
extern
bool
RelationContainsUsableBlock ARGS((
	Relation	relation,
	BlockNumber	blockIndex,
	Size		size,
	Index		numberOfFailures
));

/*
 * RelationGetRandomBlockIndexList --
 *	Returns pointer to a static array of randomly generated block indexes.
 *
 * Note:
 *	Assumes relation is valid.
 */
extern
BlockIndexList
RelationGetRandomBlockIndexList ARGS((
	Relation	relation,
	ObjectId	id
));

#endif	/* !defined(HRndIncluded) */
@


1.5
log
@change to obsolete tupsiz.h
@
text
@d9 1
a9 1
 *	$Header: RCS/hrnd.h,v 1.4 89/09/05 17:06:40 mao C_Demo_1 $
d15 1
a15 3
#ifndef C_H
#include "c.h"
#endif
d17 2
a18 3
#include "block.h"
#include "oid.h"
#include "rel.h"
@


1.4
log
@Working version of C-only demo
@
text
@d9 1
a9 1
 *	$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/hrnd.h,v 1.3 89/04/12 19:54:18 dillon Exp $
a21 1
#include "tupsiz.h"
d104 1
a104 1
	TupleSize	size,
@


1.3
log
@c.h
@
text
@d9 1
a9 1
 *	$Header: /usr6/postgres/dillon/ptree/src/lib/H/RCS/hrnd.h,v 1.2 89/02/02 18:01:53 aoki Stab $
@


1.2
log
@MERGE WITH OLD TREE
@
text
@d9 1
a9 1
 *	$Header: hrnd.h,v 1.2 88/07/24 00:30:01 aoki Locked $
d15 1
d17 1
@


1.1
log
@Initial revision
@
text
@a0 27

; /*
; * 
; * POSTGRES Data Base Management System
; * 
; * Copyright (c) 1988 Regents of the University of California
; * 
; * Permission to use, copy, modify, and distribute this software and its
; * documentation for educational, research, and non-profit purposes and
; * without fee is hereby granted, provided that the above copyright
; * notice appear in all copies and that both that copyright notice and
; * this permission notice appear in supporting documentation, and that
; * the name of the University of California not be used in advertising
; * or publicity pertaining to distribution of the software without
; * specific, written prior permission.  Permission to incorporate this
; * software into commercial products can be obtained from the Campus
; * Software Office, 295 Evans Hall, University of California, Berkeley,
; * Ca., 94720 provided only that the the requestor give the University
; * of California a free licence to any derived software for educational
; * and research purposes.  The University of California makes no
; * representations about the suitability of this software for any
; * purpose.  It is provided "as is" without express or implied warranty.
; * 
; */



d9 1
a9 1
 *	$Header: hrnd.h,v 1.1 88/11/11 16:42:17 postgres Exp $
@
