Skip to content

Give the nearest-neighbour cursors classes of their own - #132

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:feat/nn-cursor-classes
Sep 3, 2026
Merged

Give the nearest-neighbour cursors classes of their own#132
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:feat/nn-cursor-classes

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

rtree_nn_cursor_open answers an RTreeNNCursor * that _next walks and
_close frees, and sptree_nn_cursor_* do the same for an SPNNCursor *.
Both types are typedef struct X X; in meos.h — published without their
layout, registered in no enum — so they are Value leaves stating a null
temptype, as RTree and SPTree themselves are.

The three cursor entries move off the tree's class onto the cursor's, longest
prefix winning: a cursor is opened FROM a tree and then walked on its own, so
open belongs to the cursor it answers rather than among the tree's twenty
methods. RTree and SPTree read 20 methods each against 23, and the cursors 3.

Without a class for the cursor a binding reaches none of the three, which is
the whole kNN surface: the tree can be built and searched by containment while
the question "which entries are nearest" has no answer.

`rtree_nn_cursor_open` answers an `RTreeNNCursor *` that `_next` walks and
`_close` frees, and `sptree_nn_cursor_*` do the same for an `SPNNCursor *`.
Both types are `typedef struct X X;` in `meos.h` — published without their
layout, registered in no enum — so they are `Value` leaves stating a null
temptype, as `RTree` and `SPTree` themselves are.

The three cursor entries move off the tree's class onto the cursor's, longest
prefix winning: a cursor is opened FROM a tree and then walked on its own, so
`open` belongs to the cursor it answers rather than among the tree's twenty
methods. RTree and SPTree read 20 methods each against 23, and the cursors 3.

Without a class for the cursor a binding reaches none of the three, which is
the whole kNN surface: the tree can be built and searched by containment while
the question "which entries are nearest" has no answer.
@estebanzimanyi
estebanzimanyi merged commit a36c79c into MobilityDB:master Sep 3, 2026
3 checks passed
@estebanzimanyi
estebanzimanyi deleted the feat/nn-cursor-classes branch September 3, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant