1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* vacuum.h--
|
1997-09-07 07:04:48 +02:00
|
|
|
* header file for postgres vacuum cleaner
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
1997-09-08 23:56:23 +02:00
|
|
|
* $Id: vacuum.h,v 1.10 1997/09/08 21:51:47 momjian Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef VACUUM_H
|
|
|
|
#define VACUUM_H
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1997-02-07 17:24:12 +01:00
|
|
|
#include <access/funcindex.h>
|
|
|
|
#include <catalog/pg_index.h>
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef struct VAttListData
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
int val_dummy;
|
1997-09-07 07:04:48 +02:00
|
|
|
struct VAttListData *val_next;
|
1997-09-08 23:56:23 +02:00
|
|
|
} VAttListData;
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
typedef VAttListData *VAttList;
|
|
|
|
|
|
|
|
typedef struct VPageDescrData
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
BlockNumber vpd_blkno; /* BlockNumber of this Page */
|
|
|
|
Size vpd_free; /* FreeSpace on this Page */
|
|
|
|
uint16 vpd_nusd; /* Number of OffNums used by vacuum */
|
|
|
|
uint16 vpd_noff; /* Number of OffNums free or to be free */
|
|
|
|
OffsetNumber vpd_voff[1]; /* Array of its OffNums */
|
1997-09-08 23:56:23 +02:00
|
|
|
} VPageDescrData;
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
typedef VPageDescrData *VPageDescr;
|
|
|
|
|
|
|
|
typedef struct VPageListData
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
int vpl_nemend; /* Number of "empty" end-pages */
|
|
|
|
int vpl_npages; /* Number of pages in vpl_pgdesc */
|
|
|
|
VPageDescr *vpl_pgdesc; /* Descriptions of pages */
|
1997-09-08 23:56:23 +02:00
|
|
|
} VPageListData;
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
typedef VPageListData *VPageList;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
FuncIndexInfo finfo;
|
|
|
|
FuncIndexInfo *finfoP;
|
|
|
|
IndexTupleForm tform;
|
|
|
|
int natts;
|
1997-09-08 23:56:23 +02:00
|
|
|
} IndDesc;
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
AttributeTupleForm attr;
|
1997-09-08 04:41:22 +02:00
|
|
|
Datum best,
|
|
|
|
guess1,
|
|
|
|
guess2,
|
|
|
|
max,
|
|
|
|
min;
|
|
|
|
int16 best_len,
|
|
|
|
guess1_len,
|
|
|
|
guess2_len,
|
|
|
|
max_len,
|
|
|
|
min_len;
|
|
|
|
int32 best_cnt,
|
|
|
|
guess1_cnt,
|
|
|
|
guess1_hits,
|
|
|
|
guess2_hits,
|
|
|
|
null_cnt,
|
|
|
|
nonnull_cnt;
|
|
|
|
int32 max_cnt,
|
|
|
|
min_cnt;
|
|
|
|
func_ptr f_cmpeq,
|
|
|
|
f_cmplt,
|
|
|
|
f_cmpgt;
|
|
|
|
regproc outfunc;
|
|
|
|
bool initialized;
|
1997-09-08 23:56:23 +02:00
|
|
|
} VacAttrStats;
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
typedef struct VRelListData
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
Oid vrl_relid;
|
1997-09-07 07:04:48 +02:00
|
|
|
struct VRelListData *vrl_next;
|
1997-09-08 23:56:23 +02:00
|
|
|
} VRelListData;
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
typedef VRelListData *VRelList;
|
|
|
|
|
|
|
|
typedef struct VRelStats
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
Oid relid;
|
|
|
|
int ntups;
|
|
|
|
int npages;
|
|
|
|
Size min_tlen;
|
|
|
|
Size max_tlen;
|
|
|
|
bool hasindex;
|
|
|
|
int va_natts; /* number of attrs being analyzed */
|
|
|
|
VacAttrStats *vacattrstats;
|
1997-09-08 23:56:23 +02:00
|
|
|
} VRelStats;
|
1997-09-08 04:41:22 +02:00
|
|
|
|
|
|
|
extern bool VacuumRunning;
|
|
|
|
|
|
|
|
extern void vc_abort(void);
|
1997-09-08 23:56:23 +02:00
|
|
|
extern void vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
#define ATTNVALS_SCALE 1000000000 /* XXX so it can act as a float4 */
|
|
|
|
|
|
|
|
#endif /* VACUUM_H */
|