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

Akka.Persistence.Sqlite WriteJournal should create database with indexed tuple (persistence_id, sequence_nr) #4470

Open
voltcode opened this issue Jun 10, 2020 · 3 comments

Comments

@voltcode
Copy link
Contributor

voltcode commented Jun 10, 2020

in SqliteQueryExecutor.cs (the Batch... as well)

the primary key is OrderingColumn, which isn't used apart from byTag queries.
at the same time , there is only a UNIQUE constraint on columns (PersistenceIdColumnName, SequenceNrColumnName) even though those columns are more often used in basic queries.

It should be evaluated whether making the tuple the clustered index of the table is an even better approach (https://www.sqlite.org/withoutrowid.html) depending on the use case, especially if one does not need the 'byTag' queries.

There are also some discrepancies between MsSql and Sqlite table schema, perhaps there are some optimizations that should be moved to sqlite (I mean the index on the sequence_nr column).

@object
Copy link
Contributor

object commented Jun 10, 2020

Unique constraint implies a unique index:

https://sqlite.org/lang_createtable.html#uniqueconst

@voltcode
Copy link
Contributor Author

updated the description after a mistake on my part.

@Aaronontheweb
Copy link
Member

I'd be happy to accept a PR for this - we'll also need a schema migration script that users can run though.

@Aaronontheweb Aaronontheweb added this to the 1.4.8 milestone Jun 10, 2020
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.8, 1.4.9 Jun 17, 2020
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.9, 1.4.10 Jul 21, 2020
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.10, 1.4.11 Aug 20, 2020
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.11, 1.4.12 Nov 5, 2020
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.12, 1.4.13 Nov 16, 2020
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.13, 1.4.14 Dec 16, 2020
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.14, 1.4.15 Dec 30, 2020
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.15, 1.4.16 Jan 20, 2021
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.17, 1.4.18 Mar 11, 2021
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.18, 1.4.19 Mar 23, 2021
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.19, 1.4.20 Apr 28, 2021
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.20, 1.4.21 May 12, 2021
@Aaronontheweb Aaronontheweb removed this from the 1.4.21 milestone Jun 16, 2021
@Aaronontheweb Aaronontheweb added this to the 1.4.36 milestone Mar 18, 2022
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.36, 1.4.37, 1.4.38 Apr 14, 2022
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.38, 1.4.39 May 25, 2022
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.39, 1.4.40 Jun 1, 2022
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.40, 1.4.41 Jul 27, 2022
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.41, 1.4.42 Sep 7, 2022
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.42, 1.4.43, 1.4.44 Sep 23, 2022
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.44, 1.4.45, 1.4.46 Oct 17, 2022
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.46, 1.4.47 Nov 15, 2022
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.47, 1.4.48 Dec 9, 2022
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.48, 1.4.49 Jan 5, 2023
@Aaronontheweb Aaronontheweb modified the milestones: 1.4.49, 1.4.50 Jan 26, 2023
@Aaronontheweb Aaronontheweb removed this from the 1.4.50 milestone Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants