Assuming that the following query is legitimate and executes successfully, is there any way to speed it up?
SELECT foo from T1 --T1 is a huge (>5e6 rows) table with no indexes UNION SELECT bar from T1 UNION SELECT baz from T1 UNION SELECT qux from T1
The four columns shown above are all of type
nvarchar(128), non-sparse and nullable. I am using SQL Server 2008. Thanks!
EDIT: Provided more info. I cannot add indices because it is a Stage table. Also, removing the
DISTINCTs; I totally forgot about that.
Phil: How do I consolidate this into a single query?