April 14, 2010 at 2:26 pm
I have to update millions of rows. I'm breaking it into batches based on date. I have an index on date, but the estimated query plan shows that it's going to do a table scan. Is there a way to get it to use the index ? I don't have a primary key, just an identity field for uniqueness.
April 14, 2010 at 2:37 pm
select a.*, b.*
from a
join b with (index(b_col1_index)) on a.id=b.id
Something like this?
April 14, 2010 at 2:59 pm
Maybe,.. join the table to itself, with a hint on the join. But I don't have a unique index to join on.
April 14, 2010 at 3:33 pm
select *
FROM TableA with (index(IX_TableA))
IX_TableA = Index on date
I am thinking something like this
April 14, 2010 at 6:18 pm
The index hint works with a select. The problem is that I am doing a lot of updates.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply