Skip to content

Commit 7626967

Browse files
author
Artur Zakirov
committed
It seems rum works
1 parent 6177a5b commit 7626967

File tree

6 files changed

+35
-2
lines changed

6 files changed

+35
-2
lines changed

ginget.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,6 +2080,8 @@ gingetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
20802080
int64 ntids;
20812081
bool recheck;
20822082

2083+
elog(LOG, "gingetbitmap");
2084+
20832085
/*
20842086
* Set up the scan keys, and check for unsatisfiable query.
20852087
*/

gininsert.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,8 @@ ginbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
633633
MemoryContext oldCtx;
634634
OffsetNumber attnum;
635635

636+
elog(LOG, "ginbuild");
637+
636638
if (RelationGetNumberOfBlocks(index) != 0)
637639
elog(ERROR, "index \"%s\" already contains data",
638640
RelationGetRelationName(index));
@@ -759,6 +761,8 @@ ginbuildempty(Relation index)
759761
Buffer RootBuffer,
760762
MetaBuffer;
761763

764+
elog(LOG, "ginbuildempty");
765+
762766
/* An empty GIN index has two pages. */
763767
MetaBuffer =
764768
ReadBufferExtended(index, INIT_FORKNUM, P_NEW, RBM_NORMAL, NULL);
@@ -818,6 +822,8 @@ gininsert(Relation index, Datum *values, bool *isnull,
818822
MemoryContext insertCtx;
819823
int i;
820824

825+
elog(LOG, "gininsert");
826+
821827
insertCtx = AllocSetContextCreate(CurrentMemoryContext,
822828
"Gin insert temporary context",
823829
ALLOCSET_DEFAULT_MINSIZE,

ginscan.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ ginbeginscan(Relation rel, int nkeys, int norderbys)
2727
IndexScanDesc scan;
2828
GinScanOpaque so;
2929

30+
elog(LOG, "ginbeginscan");
31+
3032
scan = RelationGetIndexScan(rel, nkeys, norderbys);
3133

3234
/* allocate private workspace */
@@ -434,10 +436,11 @@ void
434436
ginrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
435437
ScanKey orderbys, int norderbys)
436438
{
437-
438439
/* remaining arguments are ignored */
439440
GinScanOpaque so = (GinScanOpaque) scan->opaque;
440441

442+
elog(LOG, "ginrescan");
443+
441444
so->firstCall = true;
442445

443446
freeScanKeys(so);
@@ -456,6 +459,8 @@ ginendscan(IndexScanDesc scan)
456459
{
457460
GinScanOpaque so = (GinScanOpaque) scan->opaque;
458461

462+
elog(LOG, "ginendscan");
463+
459464
freeScanKeys(so);
460465

461466
if (so->sortstate)

ginutil.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "miscadmin.h"
2121
#include "storage/indexfsm.h"
2222
#include "storage/lmgr.h"
23+
#include "utils/index_selfuncs.h"
2324

2425
#include "rum.h"
2526

@@ -57,7 +58,7 @@ rumhandler(PG_FUNCTION_ARGS)
5758
amroutine->ambulkdelete = ginbulkdelete;
5859
amroutine->amvacuumcleanup = ginvacuumcleanup;
5960
amroutine->amcanreturn = NULL;
60-
// amroutine->amcostestimate = gincostestimate;
61+
amroutine->amcostestimate = gincostestimate;
6162
amroutine->amoptions = ginoptions;
6263
// amroutine->amvalidate = ginvalidate;
6364
amroutine->ambeginscan = ginbeginscan;
@@ -662,6 +663,8 @@ ginoptions(Datum reloptions, bool validate)
662663
{"fastupdate", RELOPT_TYPE_BOOL, offsetof(GinOptions, useFastUpdate)}
663664
};
664665

666+
elog(LOG, "ginoptions");
667+
665668
options = parseRelOptions(reloptions, validate, RELOPT_KIND_GIN,
666669
&numoptions);
667670

ginvacuum.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,8 @@ ginbulkdelete(IndexVacuumInfo *info,
722722
OffsetNumber attnumOfPostingTree[BLCKSZ / (sizeof(IndexTupleData) + sizeof(ItemId))];
723723
uint32 nRoot;
724724

725+
elog(LOG, "ginbulkdelete");
726+
725727
gvs.index = index;
726728
gvs.callback = callback;
727729
gvs.callback_state = callback_state;
@@ -838,6 +840,8 @@ ginvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
838840
GinState ginstate;
839841
GinStatsData idxStat;
840842

843+
elog(LOG, "ginvacuumcleanup");
844+
841845
/*
842846
* In an autovacuum analyze, we want to clean up pending insertions.
843847
* Otherwise, an ANALYZE-only call is a no-op.

rum--1.0.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,16 @@ LANGUAGE C;
55

66
-- Access method
77
CREATE ACCESS METHOD rum TYPE INDEX HANDLER rumhandler;
8+
9+
-- Opclasses
10+
CREATE OPERATOR CLASS rum_tsvector_ops
11+
FOR TYPE tsvector USING rum
12+
AS
13+
OPERATOR 1 @@ (tsvector, tsquery),
14+
OPERATOR 2 @@@ (tsvector, tsquery),
15+
FUNCTION 1 bttextcmp(text, text),
16+
FUNCTION 2 gin_extract_tsvector(tsvector,internal,internal),
17+
FUNCTION 3 gin_extract_tsquery(tsvector,internal,smallint,internal,internal,internal,internal),
18+
FUNCTION 4 gin_tsquery_consistent(internal,smallint,tsvector,int,internal,internal,internal,internal),
19+
FUNCTION 5 gin_cmp_prefix(text,text,smallint,internal),
20+
STORAGE text;

0 commit comments

Comments
 (0)