JasperFx / marten

.NET Transactional Document DB and Event Store on PostgreSQL
https://martendb.io
MIT License
2.79k stars 441 forks source link

Avoid wasted db round trips by not loading single stream projections for new streams #3311

Closed elexisvenator closed 1 month ago

elexisvenator commented 1 month ago

Found as part of https://github.com/JasperFx/marten/issues/3307, if you start 1000 streams and have 1 inline projection, then there will be 1000 calls to fetch the current inline projection, one for each stream. By testing if the slicer is for single streams and the sliced events represent the start of a stream, we can eliminate these calls.