﻿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
25230	Change to Query.get_count() causes big performance hit	dexity		"Recent pull merge https://github.com/django/django/commit/c7fd9b242d2d63406f1de6cc3204e35aaa025233?diff=unified generates SQL which causes severe performance hit when using distinct parameter.
Instead of getting something like:
{{{SELECT DISTINCT COUNT('*') FROM some_model;}}}

it generates SQL query which looks:
{{{SELECT COUNT('*') FROM (SELECT DISTINCT * FROM some_model) subquery;}}}

Related ticket: https://code.djangoproject.com/ticket/23875
"	Cleanup/optimization	new	Database layer (models, ORM)	1.8	Normal				Accepted	1	0	0	1	0	0
