Skip to content

An exact count is published for a relationship path condition on a related custom index #3926

Open

Description

@kriszyp

Problem

Table.search's exact-count path decides whether a result set is approximate with touchesCustomIndex (resources/Table.ts). For a relationship path condition it reads only the path's first segment against the queried table's indexes, so a condition that reaches a related table's custom (HNSW) index through a to-one path, such as ['owner', 'embedding'] with a vector comparator, is treated as exact. A count requested as exact can then be published from a bounded candidate set.

Expected

Follow the path through each relationship and check the related table's index for the leaf, as the same function now does for a same-record group ({ attribute, conditions }).

Pre-existing; found while reviewing the existential relationship conditions change.

Review-Deferral: 05b2c74b12ea648a severity=minor category=correctness

🤖 Generated by Claude Opus 5.5 (Claude Code); posted via @kriszyp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    P3

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions