Do not join ttTable to a Real table. Epicor will pull in ALL Database records into memory before it filters it.
As for will Epicor ever fix the behind the scenes generated code… unsure cc: @timshuwy