Postgres occasionally slow to query
I unfortunately don't know much about postgres on AWS, my company is just starting to move that way, but when a vacuum runs here it does create disk io that could potentially slow down a query.  It could be that the locks are on resource contention more as opposed to Postgres Locks.