Skip to content

FilterVisitor is defeated by RecordQueryTypeFilterPlan #1880

Open
@MMcM

Description

@MMcM

The problem is that the indexFilters need to be run against a partial record while the type filter indicates that the index entries do not all correspond to the same record type.

The correct fix may well be to eliminate partial records in favor of being able to run filter expressions against the index entry more directly through some Value-like meta-data.

It might be possible, though, to refactor FilterVisitor (and RecordQueryPlannerSubstitutionVisitor) to build a partial record using one of the index record types (for instance, the one for the type filter) only for the purpose of running the filter, and then immediately do RecordQueryFetchFromPartialRecordPlan, then the RecordQueryTypeFilterPlan, then any residualFilters (which are allowed to use fields specific to that type). This is (kind of) valid because the pre-fetch filters must be on fields only in the index entry and so common to all indexed record types. They might be in the same place (for instance, inside a common included header sub-message) or not, but that's okay if the only need is to evaluate those filters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance issuesplannerRelated to the query planner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions