Possible reasons for irregularly high query execution time?
That spike is probably caused by dirty data pages being flushed to disk. Raise the checkpoint_segments parameter in the postgresql.conf file.

http://www.postgresql.org/docs/current/static/runtime-config-wal.html#RUNTIME-CONFIG-WAL-CHECKPOINTS

http://www.postgresql.org/docs/current/static/wal-configuration.html