I have a database (699221). It contains of 1.8GB data (707710). I am
doing a complex query. Which required to load a 80MB index (732287).
I restarted Postgresql so the cache is empty and it has to read the
table and index from disk. Which I understand is an expensive process.
But what I don't understand is even I split the index into a different
tablespace located on a completely separate disk (mounted on /hdd2)
there is still a very long I/O wait time. That index is only thing
exist on that disk. Any idea why? Or any way I can find out what it is
waiting for? Thanks.
(running DTrace tool kit iofile.d script to show I/O wait time by
filename and process)
bash-3.00# ./iofile.d
Tracing... Hit Ctrl-C to end.
^C
PID CMD TIME FILE
2379 postgres 23273 /export/space/postgres8.3/lib/plpgsql.so
2224 metacity 24403 /lib/libm.so.2
2379 postgres 32345
/export/space/pg_data/pg_data/data/base/699221/2619 2379 postgres
40992 /export/space/pg_data/pg_data/data/base/699221/2691 0
sched 82205 <none>
2379 postgres 273205 /export/space/postgres8.3/bin/postgres
2379 postgres 1092140 <none>
2379 postgres 59461649 /hdd2/indexes/699221/732287
(running DTrace tool kit iofildb.d script to show I/O bytes by
filename and process)
bash-3.00# ./iofileb.d
Tracing... Hit Ctrl-C to end.
^C
PID CMD KB FILE
2379 postgres 8256
/export/space/pg_data/pg_data/data/base/699221/699473 2379 postgres
87760 /hdd2/indexes/699221/732287
2379 postgres 832472
/export/space/pg_data/pg_data/data/base/699221/707710.1
2379 postgres 1048576
/export/space/pg_data/pg_data/data/base/699221/707710
--
John