1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Cube extension kNN support

Introduce distance operators over cubes:
<#> taxicab distance
<->  euclidean distance
<=> chebyshev distance

Also add kNN support of those distances in GiST opclass.

Author: Stas Kelvich
This commit is contained in:
Teodor Sigaev
2015-12-18 14:38:27 +03:00
parent 3d0c50ffa0
commit 33bd250f6c
12 changed files with 1684 additions and 4 deletions

View File

@ -47,6 +47,11 @@ typedef struct NDBOX
#define PG_GETARG_NDBOX(x) DatumGetNDBOX(PG_GETARG_DATUM(x))
#define PG_RETURN_NDBOX(x) PG_RETURN_POINTER(x)
#define CubeKNNDistanceCoord 15 /* ~> */
#define CubeKNNDistanceTaxicab 16 /* <#> */
#define CubeKNNDistanceEuclid 17 /* <-> */
#define CubeKNNDistanceChebyshev 18 /* <=> */
/* in cubescan.l */
extern int cube_yylex(void);
extern void cube_yyerror(NDBOX **result, const char *message) pg_attribute_noreturn();