mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-06 19:20:25 -05:00
update: various database performance improvements
Use eager loading where necessary and add a few indexes. The existing index on private_messages for sender_id and read was probably a typo and intended for receiver_id. The first 3 tables indexes are added to are used for queries ran on every page load: namely the new pm, new notification and warnings indicator in the navbar. Additionally, another index on genre_movie proved useful for finding all the genres when given a movie id. Perhaps, another index for finding all movies within a genre would be good as well, but will leave that for a future optimization if deemed necessary.
This commit is contained in:
@@ -38,7 +38,7 @@ class InviteController extends Controller
|
||||
|
||||
return view('user.invite.index', [
|
||||
'user' => $user,
|
||||
'invites' => $user->sentInvite()->withTrashed()->with(['sender', 'receiver'])->latest()->paginate(25),
|
||||
'invites' => $user->sentInvite()->withTrashed()->with(['sender.group', 'receiver.group'])->latest()->paginate(25),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user