To improve performance `UNION ALL` could have been used if supported. See #2120