When using a local database (running in docker, through Laraval Sail), database queries in my Laravel/React application are always done in a fraction of a second. Yet when connecting to a postgresql db on digitalocean, the first query on a page often takes ~5 seconds.
When connecting to the remote database through a database explorer (dbeaver) everything is really fast, both connecting and doing queries are always done in milliseconds.
What could cause this, and how would I go about debugging this? It seems something is being done that always fails, and after a 5 second timeout the Laravel application decides to take a different approach.