Skip to content

Should operations on multi geo indexes emit duplicates? #3351

Closed

Description

@danielmewes

This came up in rethinkdb/docs#580

Assume you have a multi geo index on the field geo and insert the following document:

{
  id: "abc",
  geo: [r.point(1, 1), r.point(1, 1)]
}

and then run getIntersecting(r.circle([1, 1], 10), {index: "geo"}) or getNearest(r.point(1, 1), {index: "geo"}) on that table.

Right now you would get only one result from those queries. We could possibly change this to return the document twice. This would be more consistent with how non-geo multi indexes behave when you use getAll or between on them.

Emitting suplicated will require some additional code to implement though. This is because geospatial indexes generally have to filter duplicates, because a single document might appear in multiple places of the index (even without a multi index). We would have to tweak this duplicate filtering to let duplicates that are due to multiple multi index keys through, while still filtering the ones that are due to how the index itself works. We already attach a "tag" to every secondary index key, which is different for each multi index key. We could use this "tag" to distinguish the different types of duplicates.

This is fairly low priority.

Activity

  1. added this to the backlog milestone on Nov 18, 2014
  2. danielmewes commented on Nov 18, 2014

    @danielmewes
    MemberAuthor

    (my personal opinion is that this is not worth doing, i.e. we should just keep the current behavior)

  3. modified the milestones: 2.3, backlog on Feb 13, 2016
  4. self-assigned this
    on Feb 13, 2016
  5. danielmewes commented on Feb 13, 2016

    @danielmewes
    MemberAuthor

    I went ahead and changed this as part of #4777
    This was necessary to make getIntersecting changefeeds work in a consistent way.

  6. danielmewes commented on Feb 13, 2016

    @danielmewes
    MemberAuthor

    The change is in code review 3476.

  7. danielmewes commented on Mar 30, 2016

    @danielmewes
    MemberAuthor

    Since #4777 is delayed because of bugs, this likely won't make it into 2.3 either.

  8. modified the milestones: , 2.3 on Mar 30, 2016
  9. modified the milestones: 2.3, on Mar 30, 2016
  10. danielmewes commented on Mar 30, 2016

    @danielmewes
    MemberAuthor

    Implemented in next 9e3bba0

  11. added a commit that references this issue on Aug 7, 2026
    97a5ad1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions