Skip to content

Secondary index support for non-PK Where optimization via KGroupedTable #538

@masesdevelopers

Description

@masesdevelopers

Problem

Where on non-PK properties (e.g. FK, arbitrary columns) always requires a full scan.
Kafka Streams supports KTable.groupBy()KGroupedTable which can maintain
secondary indexes — but requires topology declaration before Streams startup.

Proposed change

  • Opt-in per property via fluent API or attribute (e.g. HasSecondaryIndex(x => x.BlogId))
  • KEFCore generates the KGroupedTable topology at bootstrap for each indexed property
  • Query optimizer detects Where on indexed property and routes to secondary KTable
    instead of full scan

Constraint

Cannot be added at runtime — topology must be defined before KafkaStreams.start().

Metadata

Metadata

Labels

.NETPull requests that update .net codeKEFCoreThe issue is releated to KEFCoreenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions