Skip to content

Commit b9d31eb

Browse files
author
Artur Zakirov
committed
Removed unused includes, added the function rumvalidate()
1 parent 7b75227 commit b9d31eb

File tree

12 files changed

+301
-36
lines changed

12 files changed

+301
-36
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MODULE_big = rum
44
OBJS = rumsort.o rum_ts_utils.o \
55
rumbtree.o rumbulk.o rumdatapage.o \
66
rumentrypage.o rumfast.o rumget.o ruminsert.o \
7-
rumscan.o rumutil.o rumvacuum.o $(WIN32RES)
7+
rumscan.o rumutil.o rumvacuum.o rumvalidate.o $(WIN32RES)
88

99
EXTENSION = rum
1010
DATA = rum--1.0.sql

rum.h

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,13 @@
1313
#define __RUM_H__
1414

1515
#include "access/amapi.h"
16-
#include "access/genam.h"
1716
#include "access/generic_xlog.h"
1817
#include "access/gin.h"
1918
#include "access/itup.h"
20-
#include "fmgr.h"
2119
#include "lib/rbtree.h"
2220
#include "storage/bufmgr.h"
23-
#include "utils/tuplesort.h"
2421

25-
// typedef struct RumXLogRecData
26-
// {
27-
// char *data; /* start of rmgr data to include */
28-
// uint32 len; /* length of rmgr data to include */
29-
// Buffer buffer; /* buffer associated with data, if any */
30-
// bool buffer_std; /* buffer has standard pd_lower/pd_upper */
31-
// struct RumXLogRecData *next; /* next struct in chain, or NULL */
32-
// } RumXLogRecData;
22+
#include "rumsort.h"
3323

3424
/*
3525
* Page opaque data in a inverted index page.
@@ -686,6 +676,9 @@ typedef struct
686676
bool addInfoIsNull;
687677
} RumEntryAccumulatorItem;
688678

679+
/* rumvalidate.c */
680+
extern bool rumvalidate(Oid opclassoid);
681+
689682
/* rumbulk.c */
690683
typedef struct RumEntryAccumulator
691684
{
@@ -738,9 +731,10 @@ extern void rumInsertCleanup(RumState *rumstate,
738731
bool vac_delay, IndexBulkDeleteResult *stats);
739732

740733
/* rum_ts_utils.c */
741-
#define RUM_CONFIG_PROC 7
742-
#define RUM_PRE_CONSISTENT_PROC 8
743-
#define RUM_ORDERING_PROC 9
734+
#define RUM_CONFIG_PROC 7
735+
#define RUM_PRE_CONSISTENT_PROC 8
736+
#define RUM_ORDERING_PROC 9
737+
#define RUMNProcs 9
744738

745739
extern Datum rum_extract_tsvector(PG_FUNCTION_ARGS);
746740
extern Datum rum_extract_tsquery(PG_FUNCTION_ARGS);

rum_ts_utils.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "postgres.h"
1313

1414
#include "catalog/pg_type.h"
15-
#include "tsearch/ts_type.h"
1615
#include "tsearch/ts_utils.h"
1716
#include "utils/builtins.h"
1817

rumbtree.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#include "postgres.h"
1515

1616
#include "access/generic_xlog.h"
17-
#include "miscadmin.h"
18-
#include "utils/rel.h"
1917

2018
#include "rum.h"
2119

rumdatapage.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313

1414
#include "postgres.h"
1515

16-
#include "utils/datum.h"
17-
#include "utils/rel.h"
18-
1916
#include "rum.h"
2017

2118
/* Does datatype allow packing into the 1-byte-header varlena format? */

rumentrypage.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313

1414
#include "postgres.h"
1515

16-
#include "utils/rel.h"
17-
#include "utils/datum.h"
18-
1916
#include "rum.h"
2017

2118
/*

rumfast.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "commands/vacuum.h"
2222
#include "miscadmin.h"
2323
#include "utils/memutils.h"
24-
#include "utils/rel.h"
2524
#include "utils/datum.h"
2625

2726
#include "rum.h"

ruminsert.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,9 @@
1414
#include "postgres.h"
1515

1616
#include "access/generic_xlog.h"
17-
#include "access/heapam_xlog.h"
1817
#include "catalog/index.h"
1918
#include "miscadmin.h"
20-
#include "storage/bufmgr.h"
21-
#include "storage/smgr.h"
22-
#include "storage/indexfsm.h"
2319
#include "utils/memutils.h"
24-
#include "utils/rel.h"
2520
#include "utils/datum.h"
2621

2722
#include "rum.h"

rumscan.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "access/relscan.h"
1717
#include "pgstat.h"
1818
#include "utils/memutils.h"
19-
#include "utils/rel.h"
2019

2120
#include "rum.h"
2221

rumutil.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313

1414
#include "postgres.h"
1515

16-
#include "access/generic_xlog.h"
1716
#include "access/reloptions.h"
1817
#include "catalog/pg_collation.h"
1918
#include "catalog/pg_type.h"
20-
#include "miscadmin.h"
2119
#include "storage/indexfsm.h"
2220
#include "storage/lmgr.h"
2321
#include "utils/guc.h"
@@ -79,7 +77,7 @@ rumhandler(PG_FUNCTION_ARGS)
7977
amroutine->amcanreturn = NULL;
8078
amroutine->amcostestimate = gincostestimate;
8179
amroutine->amoptions = rumoptions;
82-
// amroutine->amvalidate = rumvalidate;
80+
amroutine->amvalidate = rumvalidate;
8381
amroutine->ambeginscan = rumbeginscan;
8482
amroutine->amrescan = rumrescan;
8583
amroutine->amgettuple = NULL;

rumvacuum.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313

1414
#include "postgres.h"
1515

16-
#include "access/generic_xlog.h"
1716
#include "commands/vacuum.h"
18-
#include "miscadmin.h"
1917
#include "postmaster/autovacuum.h"
2018
#include "storage/indexfsm.h"
2119
#include "storage/lmgr.h"

0 commit comments

Comments
 (0)