planbuilder: compute table name first.

Setting the table name in the plan upfront gives us
more info about the query, which is useful for
blacklisting, etc.