Sort by least used table when choosing order of tables to assign

When building the order to assign tables find the table that is used
least and assign that one first.