sql - Updating large number of records without an index on a nvarchar column -
is there way relatively update large number of records in sql server 2014, filtering on nvarchar(x)
column, when there no index on column?
eg. i'd run:
update products set active = 1 productbrand = 'brand name'
on product
table millions of rows, , there no index on productbrand
.
creation of index takes around 45 minutes , update table bit faster.
we want perform operation fastest way possible, creating index takes lots of time. wandering if there other ways using index.
(creating index on name column , leaving there of course practice, rebuilding time time)
check product table, maybe have index on productbrandid, if not, can create new tmpproduct table same structure , default 1 in "active" field.
insert registers new table
drop original table , rename tmpproduct product
you must ensure triggers , references recreated
Comments
Post a Comment