{"comment":{"url":"https://api.github.com/repos/c2corg/v6_api/comments/14615822","html_url":"https://github.com/c2corg/v6_api/commit/4ab0db79899c79e533def901d8cff3145878c42d#commitcomment-14615822","id":14615822,"user":{"login":"gberaudo","id":7294662,"avatar_url":"https://avatars.githubusercontent.com/u/7294662?v=3","gravatar_id":"","url":"https://api.github.com/users/gberaudo","html_url":"https://github.com/gberaudo","followers_url":"https://api.github.com/users/gberaudo/followers","following_url":"https://api.github.com/users/gberaudo/following{/other_user}","gists_url":"https://api.github.com/users/gberaudo/gists{/gist_id}","starred_url":"https://api.github.com/users/gberaudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gberaudo/subscriptions","organizations_url":"https://api.github.com/users/gberaudo/orgs","repos_url":"https://api.github.com/users/gberaudo/repos","events_url":"https://api.github.com/users/gberaudo/events{/privacy}","received_events_url":"https://api.github.com/users/gberaudo/received_events","type":"User","site_admin":false},"position":79,"line":60,"path":"c2corg_api/security/roles.py","commit_id":"4ab0db79899c79e533def901d8cff3145878c42d","created_at":"2015-11-25T13:27:43Z","updated_at":"2015-11-25T13:27:43Z","body":"Deleting 100'000 tokens based on the indexed expire value takes 70ms.\r\nThat seems reasonable.\r\n\r\nc2corg_gberaudo=# explain analyze delete from users.token where expire > now();\r\n                                                    QUERY PLAN                                                     \r\n-------------------------------------------------------------------------------------------------------------------\r\n Delete on token  (cost=0.00..2138.00 rows=100000 width=6) (actual time=77.213..77.213 rows=0 loops=1)\r\n   ->  Seq Scan on token  (cost=0.00..2138.00 rows=100000 width=6) (actual time=0.004..20.934 rows=100000 loops=1)\r\n         Filter: (expire > now())\r\n Planning time: 0.104 ms\r\n Execution time: 77.226 ms\r\n(5 rows)"}}