Skip to content

Conversation

tchaumeny
Copy link

A report on our PostgreSQL database use showed that the most consuming query was this one :

SELECT "oauth2_provider_accesstoken"."id", "oauth2_provider_accesstoken"."user_id", "oauth2_provider_accesstoken"."token", "oauth2_provider_accesstoken"."application_id", "oauth2_provider_accesstoken"."expires", "oauth2_provider_accesstoken"."scope" FROM "oauth2_provider_accesstoken" WHERE "oauth2_provider_accesstoken"."token" = '';

This pull request adds an index on the AccessToken.token field so that this very frequent query can run much faster.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling f5da293 on Polyconseil:speedup_token into e983442 on evonove:master.

@synasius
Copy link
Contributor

synasius commented Sep 2, 2014

that would be nice to merge but it's breaking tests.. please try to fix that or we can't merge!

@tchaumeny
Copy link
Author

Hi @synasius. This failure is not related to my commit and happens randomly on some build (see https://travis-ci.org/evonove/django-oauth-toolkit/jobs/29046466 for instance).

@palazzem
Copy link
Contributor

palazzem commented Sep 2, 2014

Hi @tchaumeny,
yes I can confirm that sometimes there are some failures related to Travis environment. I've launched the job again and now it says that everything is fine (at least everything which is covered by tests :)).
I leave to @synasius the last code review and the merge operation.

Thanks for your PR!

@tchaumeny
Copy link
Author

In fact, this was already done in d56ad55.

@tchaumeny tchaumeny closed this Sep 7, 2014
@fbochu fbochu deleted the speedup_token branch April 3, 2017 15:57
@martin-thoma martin-thoma mentioned this pull request Sep 11, 2023
5 tasks
@n2ygk
Copy link
Contributor

n2ygk commented Sep 11, 2023

I'm guessing that if indexeing was manually added to a migration back a long time that it got reverted if it's not in the model definition proper. I see the #1312 addresses this by adding db_index = True in the model definition.

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.

5 participants