I'm having a very strange problem when inserting rows into a table. Let me try to explain a little better:
Table1 (for example Book) with a lot of fields and one foreign key to Table2 (idVolume) and a primary key (identity - idBook). This table has a clustered index only on the primary Key. (this table has something like 10 Millions rows)
Table2 (for example Volume) with a lot of fields and a primary key (idVolume) identity. (this table has hundreds of rows)
Now, the problem starts when I make a insertion on Table2. When I made an insertion, it was taking minutes to finish, so I stopped it.
After looking into the execution plan of the query, there was something very very strange, there seems to be a clustered index scan on Table1... the problem is that since Table1 has so many rows, this index scan takes forever...
Can anyone explain me why does the insertion on Table2 makes an clustered index scan on Table1? It really doesn't make any sense to me.
Thanks in advance.
View Complete Post