Unions and performance

In case anyone is wondering, these are the things that I did to improve performance on this BAQ.

I added the JobHead table to my sub-queries that had any epicor tables in it. I didn’t use any of the fields, but it seems to have helped. That was per suggestion by @knash during our webex.

Per @danbedwards suggestion, I set a criteria for every table to set to my company. I did not use the BAQ constant to do this, that made performance worse, I set = constant and typed my company name criteria.

I created an index with Company, ShortChar03, ShortChar01, and ShortChar02. In that orders. This was per the recommendation of the SQL plan.

Doing those 3 things make the query run much faster. I’m still trying to learn how to know what things to do in these situations.

Hopefully my live roll out of this duplicates what I am seeing in the Pilot system.

2 Likes