"...we discovered a 5,800-line SQL query..."
msdn.microsoft.com
msdn.microsoft.com
If your database API generates a 5800-line query for a common use case, isn't that a flaw in the API?
Given this data, I'd advise anyone planning to use this framework to instead consider avoiding it and using a better API or even writing SQL manually if necessary.