Reason for PG being seemingly I/O bound?

From: Harshad <harshad(dot)rj(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Reason for PG being seemingly I/O bound?
Date: 2009-09-13 17:00:18
Message-ID: h8j892$sdg$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message manaus 2009-09-13 17:31:19 type conversion
Previous Message raghu ram 2009-09-13 08:23:01 Invitation to connect on LinkedIn