To increase the speed of any SQL command you should have a properly set up database, thus I do hope that your database is stored on a different disk and that the master and tempdb are on their own disk.
That being said there are several factors that affect index creation: if the table is sorted already, and since it looks like you are building this on a HEAP table I would say it's not sorted, and the other component is the column type on which you are creating the index on. The information contained in a clustered index is limited by the amount of columns or the byte size of the columns (whichever comes first) and as such some columns aren't as good candidates for being clustered indexes.
Since you are creating a unique index on a heap table you should clean it up firs so that you don't have duplicate values. This will avoid you having to build the index again.
So before you run the index creation query run this first
SELECT
barKey
FROM
(
SELECT
barKey,
COUNT(barKey) AS NoOfDuplicates
FROM
dbo.tblFactFoo WITH(NOLOCK)
GROUP BY
barKey
)
WHERE
NoOfDuplicates > 1;
After you run this and handle the duplicate records you can run the following, please note that this will use extra disk space so you'll need at least as much space as the size of that table.
CREATE UNIQUE CLUSTERED INDEX IXC_MyTable ON dbo.tblFactFoo(barKey) WITH(SORT_IN_TEMPDB)
GO
This will force the sorting (which is needed when creating a index) to occur in the tempdb database and then have it transfered back and replace your data.
An alternative would be to create a duplicate table with the same name, clumns etc, add the clustered key on it, before you add any records and then execute this command:
MERGE INTO dbo.tblFactFoo AS source
USING dbo.tblFactFooIndexed AS destination ON source.barKey = destination.barKey
WHEN NOT MATCHED BY source THEN
INSERT INTO destination(col1, col2, barKey etc) VALUES (source.col1, source.col2, source.barKey etc)
WHEN MATCHED BY source AND (add extra conditions here if needed) THEN
-- INSERT / UPDATE or DELETE depending on how you want to handle duplicate keys
Since this is a set operation this should, theoretically, work much faster since the SQL server operates on sets faster then it operates on rows. Once you're done, drop the first table and rename the second table.
Should you need more help with the MERGE command here is the link to it on MSDN: http://msdn.microsoft.com/en-us/library/bb510625.aspx