Have you tried connecting using a UNIX socket instead of a TCP socket on localhost ? On such very short queries, the TCP overhead is significant.
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных