I don't understand exactly what you did, but to me it sounds a bit like you've completely outsourced the database, eg it is no longer in the same LAN as your webserver.
Queries a very critical to latency, you really want to have the DB "as close as possible" to your webserver (well, i fact the server that runs PHP, this does not necessarily have to be the webserver) if it is a few hops away it would have to be expacted taht things will slow down significantly.