Consider this table:
create table books ( Id bigint non null primary key identity (1, 1), UniqueToken varchar (100) not null, [Text] nvarchar (max) non-null )
Imagine that we have more than 100,000 books in this table.
We now have 10,000 books of data to put in this table, some of which are in duplicate. We must first filter the duplicates, then insert new books.
One way to check for duplicates is:
select UniqueToken of books where UniqueToken in ( & # 39; first single token & # 39 ;, & # 39; second single token & # 39; - 10,000 articles here )
Does the existence of
Text column affects the performance of this query? If so, how can we optimize it?
I have the same structure, for other data. And it's not going well. A friend told me that I should divide my table into two tables as follows:
create a table BookUniqueTokens ( Id bigint non null primary key identity (1, 1), UniqueToken varchar (100) ) create table books ( Id bigint non null primary key, [Text] nvarchar (max) )
And I have to do my duplicate search algorithm on the first table only, and then insert data into both. In this way, he claimed that the performances were much better because the tables were physically separate. He claimed that
[Text] column affects everything
to select query on the