Skip to content

Todos query is still slow for me

Now we've deployed 10.6, todos queries should be fast again: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17462

But they aren't, at least for me:

SELECT "todos".*
FROM "todos"
INNER JOIN "projects" ON "projects"."id" = "todos"."project_id"
WHERE "todos"."user_id" = 443319
	AND ("todos"."state" IN ('pending'))
	AND (
		EXISTS (
			SELECT 1
			FROM "project_authorizations"
			WHERE "project_authorizations"."user_id" = 443319
				AND (project_authorizations.project_id = projects.id)
			)
		OR projects.visibility_level IN (
			10
			,20
			)
		)
ORDER BY "todos"."id" DESC LIMIT 20 OFFSET 0

Is run for me, and this consistently takes around 7 seconds.

Edited by Andreas Brandl