Changes for TopTAJoin. Changes for sorted retrieval are still pending