You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've observed the slow consent sql query similar to the issue #1454
When running
SELECT h.*
FROM hydra_oauth2_consent_request_handled AS h
JOIN hydra_oauth2_consent_request AS r ON (h.challenge = r.challenge)
WHERE (((r.subject = $1 ) AND (r.client_id = $2)) AND (r.skip = true))
AND ((h.error = '{}') AND (h.remember = true))
ORDER BY h.requested_at DESC limit 1;
The query time growth linearly with the number of records for a subject in hydra_oauth2_consent_request
For a subject that has 1040 records in hydra_oauth2_consent_request. It take 14ms to complete the query
For a subject that has 305683 records in hydra_oauth2_consent_request. It takes 23 sec to complete.
Purging the hydra_oauth2_consent_request table might mitigate the issue. However, but there is no API or shell scripts to do the cleanup. As discussed in #1574
I'm not sure Ory team is aware of this behavior. There might be a SQL optimization can be done in for this problem. Thanks.
The text was updated successfully, but these errors were encountered:
purmac
changed the title
Slow query when hydra_oauth2_consent_request
Slow query when hydra_oauth2_consent_request growth
Aug 12, 2020
Hydra Version: v1.0.0+oryOS.12
Database: CockroachDB 19.2
Hi Team,
We've observed the slow consent sql query similar to the issue #1454
When running
The query time growth linearly with the number of records for a subject in
hydra_oauth2_consent_request
For a subject that has 1040 records in
hydra_oauth2_consent_request
. It take 14ms to complete the queryFor a subject that has 305683 records in
hydra_oauth2_consent_request
. It takes 23 sec to complete.Purging the
hydra_oauth2_consent_request
table might mitigate the issue. However, but there is no API or shell scripts to do the cleanup. As discussed in #1574I'm not sure Ory team is aware of this behavior. There might be a SQL optimization can be done in for this problem. Thanks.
The text was updated successfully, but these errors were encountered: