2003-07-21 18:27:44 +08:00
|
|
|
#ifndef __TXTIDX_STAT_H__
|
|
|
|
#define __TXTIDX_STAT_H__
|
|
|
|
|
|
|
|
#include "postgres.h"
|
|
|
|
|
|
|
|
#include "access/gist.h"
|
|
|
|
#include "access/itup.h"
|
|
|
|
#include "utils/builtins.h"
|
|
|
|
#include "storage/bufpage.h"
|
|
|
|
|
2003-08-04 08:43:34 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
uint32 len;
|
|
|
|
uint32 pos;
|
|
|
|
uint32 ndoc;
|
|
|
|
uint32 nentry;
|
2003-07-21 18:27:44 +08:00
|
|
|
} StatEntry;
|
|
|
|
|
2003-08-04 08:43:34 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
2003-07-21 18:27:44 +08:00
|
|
|
int4 len;
|
|
|
|
int4 size;
|
2004-05-28 23:36:49 +08:00
|
|
|
int4 weight;
|
2003-07-21 18:27:44 +08:00
|
|
|
char data[1];
|
|
|
|
} tsstat;
|
|
|
|
|
2005-05-26 05:40:43 +08:00
|
|
|
#define STATHDRSIZE (sizeof(int4) * 4)
|
|
|
|
#define CALCSTATSIZE(x, lenstr) ( (x) * sizeof(StatEntry) + STATHDRSIZE + (lenstr) )
|
|
|
|
#define STATPTR(x) ( (StatEntry*) ( (char*)(x) + STATHDRSIZE ) )
|
|
|
|
#define STATSTRPTR(x) ( (char*)(x) + STATHDRSIZE + ( sizeof(StatEntry) * ((tsvector*)(x))->size ) )
|
|
|
|
#define STATSTRSIZE(x) ( ((tsvector*)(x))->len - STATHDRSIZE - ( sizeof(StatEntry) * ((tsvector*)(x))->size ) )
|
2003-07-21 18:27:44 +08:00
|
|
|
|
|
|
|
#endif
|