CASE-WHEN :: another trick for N+1 problem (opens in new tab)
N+1 query problem might be solved in elegant way for mid-sized tables
Read the original articleN+1 query problem might be solved in elegant way for mid-sized tables
Read the original article