Bonus
/*SQL Server Sniffs 'Answer' from the PostTypes table,
but does not sniff the PostTypeID associated to that PostType*/
SELECT COUNT(*)
FROM dbo.PostTypes pt
INNER JOIN dbo.Posts p ON pt.Id = p.PostTypeId
WHERE pt.Type = N'Answer'
/*SQL Server appropriately sniffs the PostTypeID and gets a perfect estimate*/
SELECT COUNT(*) FROM dbo.Posts
WHERE PostTypeID = '2' /*Answer*/Last updated