Reason for PG being seemingly I/O bound? - Mailing list pgsql-novice

From Harshad
Subject Reason for PG being seemingly I/O bound?
Date
Msg-id h8j892$sdg$1@ger.gmane.org
Whole thread Raw
Responses Re: Reason for PG being seemingly I/O bound?
List 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 by date:

Previous
From: jebjeb
Date:
Subject: using SQL for multi-machine job management?
Next
From: Tom Lane
Date:
Subject: Re: Reason for PG being seemingly I/O bound?