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

Commit5545068

Browse files
committed
KNNGIST, otherwise known as order-by-operator support for GIST.
This commit represents a rather heavily editorialized version ofTeodor's builtin_knngist_itself-0.8.2 and builtin_knngist_proc-0.8.1patches. I redid the opclass API to add a separate Distance methodinstead of turning the Consistent method into an illogical mess,fixed some bit-rot in the rbtree interfaces, and generally worked overthe code style and comments.There's still no non-code documentation to speak of, but I'll work onthat separately. Some contrib-module changes are also yet to come(right now, point <-> point is the only KNN-ified operator).Teodor Sigaev and Tom Lane
1 parentc0a4d3e commit5545068

File tree

16 files changed

+972
-498
lines changed

16 files changed

+972
-498
lines changed

‎src/backend/access/gist/gist.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,9 @@ gistnewroot(Relation r, Buffer buffer, IndexTuple *itup, int len, ItemPointer ke
10301030
END_CRIT_SECTION();
10311031
}
10321032

1033+
/*
1034+
* Fill a GISTSTATE with information about the index
1035+
*/
10331036
void
10341037
initGISTstate(GISTSTATE*giststate,Relationindex)
10351038
{
@@ -1064,6 +1067,13 @@ initGISTstate(GISTSTATE *giststate, Relation index)
10641067
fmgr_info_copy(&(giststate->equalFn[i]),
10651068
index_getprocinfo(index,i+1,GIST_EQUAL_PROC),
10661069
CurrentMemoryContext);
1070+
/* opclasses are not required to provide a Distance method */
1071+
if (OidIsValid(index_getprocid(index,i+1,GIST_DISTANCE_PROC)))
1072+
fmgr_info_copy(&(giststate->distanceFn[i]),
1073+
index_getprocinfo(index,i+1,GIST_DISTANCE_PROC),
1074+
CurrentMemoryContext);
1075+
else
1076+
giststate->distanceFn[i].fn_oid=InvalidOid;
10671077
}
10681078
}
10691079

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp