Writing the results to a temporary table.

* that is horribly slow .. room for improvement