Why does querying a PostgreSQL database have an overhead of a few dozens of milliseconds?
It's the overhead that the SQL client has, in this case pgAdmin.
Use a different SQL client. pgAdmin isn't known to be the fastest. You will always have an overhead. Parsing and network communication (even if everything is local) can never be avoided. The client needs to receive and display the result - that is where pgAdmin seems to be the slowest option (I have never used it myself, but this question shows up here and on Stack Overflow on a regular basis).