我在Spring JdbcTokenStore上遇到了糟糕的性能,所以我做了一些调查,发现以下查询速度很慢:
delete from oauth_access_token where token_id = ?
select token_id, authentication from oauth_access_token where token_id = ?
select token_id, token from oauth_access_token where authentication_id = ?我检查了表,似乎提供的脚本(例如,这里的https://github.com/spring-projects/spring-security-oauth/blob/master/spring-security-oauth2/src/test/resources/schema.sql)甚至没有为oauth_access_token表定义主键。
如何优化性能?是否可以安全地将token_id定义为outh_access_token的PK,并为authentication_id列添加唯一索引?
谢谢朱利奥
发布于 2018-09-12 23:48:12
我的spring boot应用程序也遇到了类似的问题,在token_id列上创建了一个唯一的索引后,性能得到了极大的提高
https://stackoverflow.com/questions/25888501
复制相似问题