Nonclustered index which includes XML column
- From: Leon Mayne <leon.rmvme@xxxxxxxx>
- Date: Tue, 09 Sep 2008 16:31:27 +0100
Hi again,
I have a table which contains an XML column, and I have a stored procedure which returns records based on two columns, e.g.
CREATE TABLE tblTest(
intRecordId int not null,
intUserId int not null,
xmlWhatever XML not null,
datDateProcessed datetime null,
intNumTries int not null default (0)
)
(something like that)
Procedure:
SELECT
intRecordId,
intUserId,
xmlWhatever,
intNumTries
FROM
tblTest
WHERE
datDateProcessed IS NULL
AND
intNumTries < 5
I can't seem to create a good index for this query which avoids a clustered index scan, because I can't add the xml column as an included column in the index, therefore the only way for the query optimiser to do it (without performing a bookmark lookup) seems to just be to scan the whole table. Is there a way to optimise this query? The table will end up having a very large number of rows in it.
.
- Follow-Ups:
- Prev by Date: RE: Stumped again
- Next by Date: RE: Nonclustered index which includes XML column
- Previous by thread: Storing RSS web feeds in the db?
- Next by thread: RE: Nonclustered index which includes XML column
- Index(es):
Relevant Pages
|