I have a PHP Application and I use Laravel Framework. When I'm developing the application its response time is not an issue. But, when I deployed it and it gets a lot of data in one of its transaction table (almost 7,000 rows as of this time) in the database it takes of almost 6 seconds to refresh the page. I only get the last 100 data from the database to view as logs. Is there such ways to shorten this response time? BTW my application only run in a local network.
Here is my code:
Route::get('/', function()
{
$users = DB::table('logs')
->join('students', 'logs.id', '=', 'students.id')
->orderBy('time_in', 'desc')
->take(100)
->get();
return View::make('index')
->with('users',$users);
});