Fixed #19717 - Removed mentions of "root QuerySet" in docs.

Thanks julien.aubert.mail@ for the report and James Pic for the patch.
Factored out common code in database backends.