i have table (languages) has only tow records and 4 columns when i run this query in laravel
(select id, name, alies, dir from language where alies = 'ar' and status = '1' limit 1) it takes 34ms any reason for this long time
That's pretty slow, have you tried other db engines? Refresh x times? Leverage indexes? Slow hard drive? Using Eloquent, query builder, raw PDOs, mysqli, ...? So little details given.
Why aren't you using Eloquent ORM for all this.. It would save your time and loading time too. Create a Model of language and after that in your controller it goes like:
There can be a lot of reasons as to why the query takes time. Some of them are already mentioned. What I would do it remove the limit = 1 from the statement since I doubt you have two alies that are the same and has status 1. However you need to consider that your query need to connect to the database, send the query through to the database that then needs to parse it and then run the query and lastly return the data to you. When running the query in MySQL I guess you mean from the mysql prompt you are already connected to the database.