The paper describes patterns of school segregation at the start of the formal schooling in the city of Rio de Janeiro, Brazil, and estimates the compositional effect (school mix-effect) on children's learning in the first two years at school. This is an important phenomenon to analyze the process of distributing educational opportunities in public and private schools. The concept of school segregation used in this paper refers to the unequal distribution of students who share specific characteristics within a group of public schools. The study uses the Segregation Index for two characteristics of disadvantaged: 1) color/race; 2) parents' education. The effect of social composition was estimated with data from a longitudinal study and analyzed separately the compositional effect for the first and second years at school. Preliminary results suggest that the patterns of school segregation observed in preschool are similar to those described in the first year of elementary school. There is, therefore, no major impact on segregation patterns in the transition between teaching stages. The models for estimating the effect of the compositional effect on student learning suggest that there is an effect, with more consistent results for the measurement of language.