I have a SQL Server installed on ubuntu with only one table (accessed via sqlcmd
) has nearly 2 trillion rows. It currently has a clustered index on column index A
(which is not useful for me).
I would like to do a select statement on the data
select b, c, d, e, f
from table
where b = 'a vehicle number'
and write the results to a .csv
file. But this query takes around 20 minutes to run on the computer even after creating a nonclustered index on column b.
I have to run the same query for 400 different vehicle numbers and it will take days to execute.
How can I make this process faster? Can I run two select statements (for two vehicles) simultaneously in some way so that both these statements are complete within 20 minutes? (not 20 + 20 = 40)?
I have a powerful PC with 128 GB RAM, 40 cores, Intel xeon 4210 @ 2.2Ghz.