FWQ
MySQL JOIN 查询性能优化:获取用户粉丝信息,使用 JOIN 还是拆分查询更优?
join 查询性能优化:使用 join 还是拆分查询? 对于获取特定用户的粉丝信息的查询,可以使用 join 操作或拆分查询。以下分析对比了两种方法的性能: join 查询 (方式一) select `friendships_friendship`.`id`, `friendships_friendship`.`from_user_id`, `friendships_friendship`.`to_user_id`, `friendships_friendship`.`created_at`, t3.`id`, t3.`password`, t3.`last_login`, t3.`is_superuser`, t3.`username`, t3.`first_name`, t3.`last_name`, t3.`email`, t3.`is_staff`, t3.`is_active`, t3.`date_joined` from `friendships_friendship`…