﻿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
30991	Optional removal of transaction and extra get() in get_or_create().	Michael Korobov	nobody	"Our app's subject is accounting and it's processing a huge amount of different data by a large amount of users. Hence the perfomance takes crucial part in this app. We've been optimizing our code recently and discovered that `get_or_create` method of `QuerySet` is generating an atomic block with a savepoint, and then makes another query to a database in case of `IntegrityError` exception. While this is really great on it's own, it slows down the app. 

The solution in attached PR is aimed to allow us to make a choice - whether to use `get_or_created` as it currently is, or skip the creation of an atomic block and avoid another possible hit to a database. New kwarg to `get_or_create` `raw=False` if set to `True` ignores both of mentioned components, making the method run faster. And if needed we can handle `IntegrityError` or make an atomic block where we indeed need it by ourselves.

"	New feature	closed	Database layer (models, ORM)	dev	Normal	wontfix	get_or_create		Unreviewed	0	0	0	0	0	0
