postgresql heavy cpu usage for indexed selects
===

We have a table with just over 40million rows. I'm running a select on the table based on 2 columns that are indexed (independently). explain analyze shows the plan as using the indexes and when I run the query manually it returns instantaneously (less than 4milliseconds). However, we have an ETL process that is repeatedly making these queries (about 20000 times or so) and during this process, the postgress process serving the client consumes a full core and most of the selects take longer than 5 seconds! I was even able to reproduce this with just running 10 of these selects on a single connection serially. A few of these 10 selects take longer than 5 seconds. If I run single selects they always finish instantaneously. What could be causing this behavior? This is a pretty powerful box with plenty of RAM and there is hardly any disk activity during this. We're currently using postgresql 9.0.7-1 on Cent OS 5.
