保存记录时如何避免对模型表单进行外键检查,因为这会产生 2 个额外的查询,并且我需要应用程序的速度。
SELECT (1) AS "a" FROM "auth_user" WHERE "auth_user"."id" = 1 LIMIT 1
和
SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."id" = 1