Slow Query
I am using api-guard in the normal way. When I look at the query times in the debug toolbar, the api-guard query is always tagged as slow:
select * from api_keyswherekey= '0b0c7be24c74c79c7efe7568b770749f1599cf60' andapi_keys.deleted_at is null limit 1
Time = 184.12ms
Why is the query so slow? What can I do to speed it up?
If I run the query direct on my database then it runs very quickly.
Hi @PaddyLock, please list technical details of your installation:
- Application version/details
- Your MySQL database size
- Application environment/Server details
- MySQL database version/details
Please be very very granular in your breakdown so that someone can get context of the scenario and see whether we can reproduce your issue.
Hi @ratatatKE here are the details
"require": {
"php": "^7.1.3",
"barryvdh/laravel-debugbar": "^3.2",
"chrisbjr/api-guard": "4.*",
"darkaonline/l5-swagger": "5.7.*",
"fideloper/proxy": "^4.0",
"flow/jsonpath": "^0.4.0",
"folklore/graphql": "^1.1",
"laravel/framework": "5.7.*",
"laravel/telescope": "^0.1.5",
"laravel/tinker": "^1.0",
"league/flysystem-cached-adapter": "^1.0"
},
MySQL 5.5.53 hosted on AWS RDS db.m4.xlarge encoding: utf8mb4 engine: innoDB only two rows in api_keys table
Server is a Docker instance: nginx, php 7.2.
I am running the docker instance locally and connecting to the RDS database externally. All other DB connections run a lot faster. It's just the api key check that shows in the profiler as being slow.

@ratatatKE