It's likely that with more constrained RAM there is a paging cycle between these two tables, as they compete for RAM. The query performs on one block at a time (in order) and one tx at a time within the block (either in order or concurrently), with the spendable and spent subqueries within the tx query. This could be rotated to perform all spendable queries in the block before (or after) all spent, significantly reducing memory contention.