Make SQL query "latency proof" I have developed an application which connects to a database over a WAN.

As long as I'm using the application on my local network, everything works fine.
When I connect over the WAN, the database request takes several seconds. The user experiences long load times when using the application from his location. The loading times are so long, that it isn't workable.

Most of the time, the query selects all the data from a table. Sometimes it only selects one line.

I think this is due to latency on the WAN. Does anyone know how I can make my queries "latency-proof"?
You can improve the WAN link or improve the query to make it more efficient. 
Other than that you are limited by the laws of physics as the data has to travel back and forth through the link there is no getting around that.