@uniqueginun This sounds more like it takes time to connect to the database rather than the query it self.
Are you using ldap, tns or something else for the database name lookup?
@Tray2 btw I tried to test the database connection process by this code
Route::get('test', function () {
try {
DB::connection()->getPdo();
if(DB::connection()->getDatabaseName()){
dd("Yes! Successfully connected to the DB: " . DB::connection()->getDatabaseName());
}else{
dd("Could not find the database. Please check your configuration.");
}
} catch (\Exception $e) {
dd("Could not connect to the database. Please check your configuration. error:" . $e );
}
});
this route took milliseconds to respond and it displayed my connection info
@MohamedTammam yes it is a valid syntax you can run raw queries. when I run queries directly from database it is super fast. the app itself is fast when no database query is involved