Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9ee014f

Browse files
committed
Bloom index contrib module
Module provides new access method. It is actually a simple Bloom filterimplemented as pgsql's index. It could give some benefits on searchwith large number of columns.Module is a single way to test generic WAL interface committed earlier.Author: Teodor Sigaev, Alexander KorotkovReviewers: Aleksander Alekseev, Michael Paquier, Jim Nasby
1 parent4e56e5a commit9ee014f

File tree

18 files changed

+2126
-0
lines changed

18 files changed

+2126
-0
lines changed

‎contrib/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ SUBDIRS = \
88
adminpack\
99
auth_delay\
1010
auto_explain\
11+
bloom\
1112
btree_gin\
1213
btree_gist\
1314
chkpass\

‎contrib/bloom/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Generated subdirectories
2+
/log/
3+
/results/
4+
/tmp_check/

‎contrib/bloom/Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# contrib/bloom/Makefile
2+
3+
MODULE_big = bloom
4+
OBJS = blcost.o blinsert.o blscan.o blutils.o blvacuum.o blvalidate.o$(WIN32RES)
5+
6+
EXTENSION = bloom
7+
DATA = bloom--1.0.sql
8+
PGFILEDESC = "bloom access method - signature file based index"
9+
10+
REGRESS = bloom
11+
12+
ifdefUSE_PGXS
13+
PG_CONFIG = pg_config
14+
PGXS :=$(shell$(PG_CONFIG) --pgxs)
15+
include$(PGXS)
16+
else
17+
subdir = contrib/bloom
18+
top_builddir = ../..
19+
include$(top_builddir)/src/Makefile.global
20+
include$(top_srcdir)/contrib/contrib-global.mk
21+
endif
22+
23+
wal-check: temp-install
24+
$(prove_check)

‎contrib/bloom/blcost.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* blcost.c
4+
*Cost estimate function for bloom indexes.
5+
*
6+
* Copyright (c) 2016, PostgreSQL Global Development Group
7+
*
8+
* IDENTIFICATION
9+
* contrib/bloom/blcost.c
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#include"postgres.h"
14+
15+
#include"fmgr.h"
16+
#include"optimizer/cost.h"
17+
#include"utils/selfuncs.h"
18+
19+
#include"bloom.h"
20+
21+
/*
22+
* Estimate cost of bloom index scan.
23+
*/
24+
void
25+
blcostestimate(PlannerInfo*root,IndexPath*path,doubleloop_count,
26+
Cost*indexStartupCost,Cost*indexTotalCost,
27+
Selectivity*indexSelectivity,double*indexCorrelation)
28+
{
29+
IndexOptInfo*index=path->indexinfo;
30+
List*qinfos;
31+
GenericCostscosts;
32+
33+
/* Do preliminary analysis of indexquals */
34+
qinfos=deconstruct_indexquals(path);
35+
36+
MemSet(&costs,0,sizeof(costs));
37+
38+
/* We have to visit all index tuples anyway */
39+
costs.numIndexTuples=index->tuples;
40+
41+
/* Use generic estimate */
42+
genericcostestimate(root,path,loop_count,qinfos,&costs);
43+
44+
*indexStartupCost=costs.indexStartupCost;
45+
*indexTotalCost=costs.indexTotalCost;
46+
*indexSelectivity=costs.indexSelectivity;
47+
*indexCorrelation=costs.indexCorrelation;
48+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp