Why is an SQL update on a table variable slower than with a temp table
<p>I have something like:</p>

<pre><code>DECLARE @tbl TABLE
(
     name varchar(255),
     type int
)

UPDATE c
SET c.name = t.name
FROM dbo.cars c
JOIN @tbl t ON t.type = c.type
</code></pre>

<p>I have a stored procedure that does something similar but it takes over 20 minutes with the table variable. It runs in less than 2 minutes if I change it from table variable to temp table. Why is this so?</p>