Isolated the spaceid search stuff

also provides relevant db and table name in a format that can be used in
SQL syntax.. for some reason.