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

Replace mailing_list_url with an integer for database relations #48

Open
andygrunwald opened this issue Jun 15, 2014 · 1 comment
Open

Comments

@andygrunwald
Copy link
Contributor

Hey,

the database scheme can be (easily) optimised.
The field mailing_lists.mailing_list_url is a VARCHAR(255) and is used many times as a unique identifier for other tables (e.g. compressed_files, messages, messages_people, etc.).
In every relation table the complete string is inserted.
This is not good for two reasons:
a) Storage: We need a lot more storage to store a (long) string such mailing_list_url
b) Joins: Joins are not so performant as integer

How to improve this?
We add a new field called mailing_list_id into table mailing_lists and define this as primary key. In every relation table we only insert the integer mailing_list_id.
With this we can avoid the two disadvantages above.

What do you think about this suggestion?

@gpoo
Copy link
Member

gpoo commented Jun 16, 2014

Have you run some profiling to check how different is the performance? If so, may you share the results?

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

2 participants