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

Use sequences instead of auto increment keys for user facing identifiers #19650

Open
bx80 opened this issue Aug 19, 2022 · 0 comments
Open

Use sequences instead of auto increment keys for user facing identifiers #19650

bx80 opened this issue Aug 19, 2022 · 0 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@bx80
Copy link
Contributor

bx80 commented Aug 19, 2022

Several unique identifiers in the Matomo UI are based on auto incrementing database primary keys, such as the site id or goal id.

When using an alternative database which uses random or UUID primary keys these values will become long, random and unfriendly to use. In order to support databases with primary key types other than auto increment these identifiers should be migrated to sequences rather than primary keys.

Suggested Approach

  • Identify all incremental primary keys which are shown in the Matomo UI.
  • Disable auto_increment for the identified primary keys.
  • For each key, rework new record insertion to generate the primary key using the sequence table and then specify it explicitly on insert.

Keys that are shown in the UI
idSite, idCustomDimension, idCustomReport, idGoal, idForm, the keys for most sub-categories under Administration > Measurables.
There may be others.

@bx80 bx80 added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

2 participants