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().
Problem
Whereon non-PK properties (e.g. FK, arbitrary columns) always requires a full scan.Kafka Streams supports
KTable.groupBy()→KGroupedTablewhich can maintainsecondary indexes — but requires topology declaration before Streams startup.
Proposed change
HasSecondaryIndex(x => x.BlogId))KGroupedTabletopology at bootstrap for each indexed propertyWhereon indexed property and routes to secondary KTableinstead of full scan
Constraint
Cannot be added at runtime — topology must be defined before
KafkaStreams.start().