I have an AWS EC2 VM. I want to run a bunch of scripts on a PostgreSQL server hosted on the same machine. When I use the IP address of the server in scripts, it took almost 5 seconds per script. But when I use the loopback address instead of server IP, it hardly took 1 second per script.
what can be the issue ?
I performed the same activity on a different server and scripts were taking almost the same time with both IP and loopback address.