﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
17535	list_detail call to len(queryset) should be queryset.exists()	hedleyroos@…	Aymeric Augustin	"Refer to https://code.djangoproject.com/browser/django/trunk/django/views/generic/list_detail.py#L97. The line `if not allow_empty and len(queryset) == 0` executes slowly for large querysets. We are already dealing with a real Queryset and not just any iterable (there is an earlier call queryset._clone) so we can use the `exists` method. I propose `if not allow_empty and not queryset.exists()`.

"	Cleanup/optimization	closed	Generic views	1.3	Normal	fixed			Accepted	0	0	0	0	0	0
