I tried the various postgres tuning parameters, but with no effect on speed. I will keep poking around to see what I might be able to do.