Well-sampled optical lightcurves of 146 gamma-ray bursts (GRBs) are compiled from literature. We identify possible emission components based on our empirical fits and present statistical analysis for these components. We find that the flares are related to prompt emission, suggesting that they could have the same origin in different episodes. The shallow decay segment is not correlated with prompt gamma-rays. It likely signals a long-lasting injected wind from GRB central engines. Early after onset peak is closely related with prompt emission. The ambient medium density profile is likely n ∝ r−1. No correlation between the late re-brightening bump and prompt gamma-rays or the onset bump is found. They may be from another jet component.