Is it faster to connect/use MySQL at localhost instead of a domain (even if the domain resolves to the same computer)?

后端 未结 3 2034
野的像风
野的像风 2021-01-17 10:32

If I have MySQL running on a Linux box, is it faster to run queries if connected to localhost than if I connect to a domain which resolves to the same box? This is from Java

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-17 10:56

    localhost is a domain that resolves to your computer, so I'd say that it's exactly as fast.

    Using a file socket might bring in a difference, though I don't know if JDBC supports it.

提交回复
热议问题