Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revision shouldn't be part of durable_state pk #558

Closed
patriknw opened this issue Apr 22, 2024 · 6 comments · Fixed by #559
Closed

revision shouldn't be part of durable_state pk #558

patriknw opened this issue Apr 22, 2024 · 6 comments · Fixed by #559

Comments

@patriknw
Copy link
Member

PRIMARY KEY(persistence_id, revision)

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.

@sebastian-alfers
Copy link
Contributor

I see that revision is also part of some indices for Durable State. Should we touch them as well?

@johanandren
Copy link
Member

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.

@sebastian-alfers
Copy link
Contributor

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.

@sebastian-alfers
Copy link
Contributor

Seems we have that index also here: https://doc.akka.io/docs/akka-projection/current/r2dbc.html

@patriknw
Copy link
Member Author

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

@efgpinto
Copy link

Just updated the script in the guide as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants