Update the detail-table-joins variant with current state

Still slower than the multi-query variant, for reasons I can't understand...