Upon further review of the code, that SQL was only generated if a customer was using a very advanced feature that almost no-one else uses. Namely because they don't know about it nor do they need it anyway. Very specific use case.