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

indexing deleted and unread fields to increase performance #153

Conversation

harrypotterismyname
Copy link

No description provided.

@coveralls
Copy link

coveralls commented Oct 3, 2016

Coverage Status

Coverage remained the same at 89.396% when pulling 38a2ee6 on suoinguon:patch-1 into 0e658dc on django-notifications:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.396% when pulling 38a2ee6 on suoinguon:patch-1 into 0e658dc on django-notifications:master.

@LegoStormtroopr
Copy link
Contributor

Do you have any evidence that this has increased performance. It seems obvious, but it would be good to see some metrics around this.

@harrypotterismyname
Copy link
Author

When you have millions of records in this table , usually there is more requests to query the unread notification than requests to write to the table . That what I have; a lot of queries take more than 30 seconds to respond in my DB .

After trying to optimize it, actually there are 3 indexes we need: unread, deleted, and recipient and unread together . This is what I have for my fork

https://github.com/suoinguon/django-notifications/blob/master/notifications/models.py

@yangyubo
Copy link
Member

@suoinguon I'd like to merge this PR, but it lacks migration script to add the db index, could you please write a migration script?

@gabrielpiccolo4
Copy link

Hey guys how is the status of this pull going? Performance is really important ;)

@psychok7
Copy link

@yangyubo @harrypotterismyname this as been sitting here for too long. if you don't mind i can take over and create the migrations so it's merged

@AlvaroLQueiroz
Copy link
Contributor

@psychok7 We appreciate that!!

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 this pull request may close these issues.

None yet

7 participants