Why are CTEs/WITHs faster than joins
I have read that the performance of the CTE/with is in some cases much better than joins. However, when joining on varchars I saw a great improvement in speed when I replaced a join with a with. With tables Customer, CustomerNickname and Address where name and originalname are varchars I would normally use the following: select * from Customer c inner join Address a on c.addressid = a.id left join CustomerNickname cn on cn.originalname = c.name If those tables have a lot of data, performance will be bad because of the varchar join. However, with the following, performance will improve from a m
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.