I have table contains three columns. If I select NVARCHAR(MAX)
column in my select statement, I see poor performance. Is it possible to create index on a NVARCHAR(MAX)
column?.
CREATE TABLE TEST
(
id primary key,
product VARCHAR(50),
Title NVARCHAR(max)
)
INSERTING MILLIONS OF RECORDS....
SELECT product, Title
FROM TEST
The table contains million of records. How can I create an index for this column? Is it really improve performance of my select statement? Or is there any other method to improve this?
nvarchar(MAX)
column. According to the documentation, "columns that are of the large object (LOB) data types ntext, text, varchar(max), nvarchar(max), varbinary(max), xml, or image cannot be specified as key columns for an index". An index won't typically improve performance of a query without aWHERE
orJOIN
clause. – TurbinateNVARCHAR
, the max would be aNVARCHAR(450)
column. Anything bigger CANNOT be indexed. – Volnak