Closed patriknw closed 5 months ago
I see that revision
is also part of some indices for Durable State. Should we touch them as well?
You mean the durable_state_slice_idx
? Looking at the query it's not obvious that it is important, no filtering done on them a neither normal nor backtracking query could be satisfied by just looking at the index anyway. Maybe @patriknw knows something I don't though.
If akka verifies that there is always only one revision for a given persistence_id, I can not imagine how that column can improve the index.
Seems we have that index also here: https://doc.akka.io/docs/akka-projection/current/r2dbc.html
I agree, shouldn't be needed in the index. Yes, please update akka-projection, we probably have ddl files in samples there also. and @efgpinto should update ddl in the Akka Guide
Just updated the script in the guide as well.
We don't ever want to store more than one row for a persistence_id. The application logic takes care of it, but would be good to have a correct primary key.