﻿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
12725	Combining Q objects with | is inefficient; lots of deep cloning	Jeff Balogh	nobody	"I have a view that was pegging the CPU for way longer than it should, so I went to do some profiling.  It turns out that the view was spending 1.4 seconds in various parts of deepcopy, and I tracked that down to ORing a bunch of Q objects.  Whenever two Q objects are combined with |, the lhs is cloned so that a new, combined Q object is returned.  The view was combining 50+ Q objects (lame, I know) and was bogged down in cloning.

The attached patch adds a `Q.or_` class method that takes any number of Q objects and keyword arguments and ORs them together without any cloning.

I thought about adding `Q.and_` for symmetry, but that's the normal operating of Q and filter to begin with, so I didn't want to add another way to do it.

Sad note:  for whatever reason, the view in question is only 120ms slower than the optimized `Q.or_` version today.  But 120ms is still a lot."		closed	Database layer (models, ORM)	1.2-alpha		fixed		Wil Clouser	Accepted	1	0	0	1	0	0
