Reason for PG being seemingly I/O bound?

Поиск
Список
Период
Сортировка
От Harshad
Тема Reason for PG being seemingly I/O bound?
Дата
Msg-id h8j892$sdg$1@ger.gmane.org
обсуждение исходный текст
Ответы Re: Reason for PG being seemingly I/O bound?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Hi,

I am trying to figure out why a very simple query turns out to be I/O bound. (I have spent more than 2 days
learning and tweaking everything from "shared_buffer" to "vm.swappiness", but not making any progress.)

The postgresql.conf is set to all defaults.
The table is called 'users' which has an INTEGER id with a UNIQUE constraint.
There are only about 1000 rows in the table.

The query and the plan is:

EXPLAIN
    SELECT null
    FROM users
    WHERE id=14601448;

                              QUERY PLAN
----------------------------------------------------------------------
 Index Scan using "userId" on users  (cost=0.00..8.27 rows=1 width=0)
   Index Cond: (id = 14601448)

I have put this query in simple.sql, and running it in a tight loop in the shell thusly:

while [ true ] ; do psql -d twinkle -U postgres -f simple.sql; done > /dev/null


(that's zsh syntax; in bash it would be while [[ true ]] ...)

The CPU utilisation of this is hardly 5%.

I have tried this on my PC as well as the production server, with several combinations of configuration settings
(including the defaults, shutting off autovacumm, shutting off synchronised_commit, shutting off fsync, etc).

What am I missing?

thanks for your help,
Harshad

В списке pgsql-novice по дате отправления:

Предыдущее
От: jebjeb
Дата:
Сообщение: using SQL for multi-machine job management?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Reason for PG being seemingly I/O bound?