  The clustering of dark halos depends not only on their mass but also on their
assembly history, a dependence we term `assembly bias'. Using a galaxy
formation model grafted onto the Millennium Simulation of the LCDM cosmogony,
we study how assembly bias affects galaxy clustering. We compare the original
simulation to `shuffled' versions where the galaxy populations are randomly
swapped among halos of similar mass, thus isolating the effects of correlations
between assembly history and environment at fixed mass. Such correlations are
ignored in the halo occupation distribution models often used populate dark
matter simulations with galaxies, but they are significant in our more
realistic simulation. Assembly bias enhances 2-point correlations by 10% for
galaxies with M_bJ-5logh brighter than -17, but suppresses them by a similar
amount for galaxies brighter than -20. When such samples are split by colour,
assembly bias is 5% stronger for red galaxies and 5% weaker for blue ones. Halo
central galaxies are differently affected by assembly bias than are galaxies of
all types. It almost doubles the correlation amplitude for faint red central
galaxies. Shuffling galaxies among halos of fixed formation redshift or
concentration in addition to fixed mass produces biases which are not much
smaller than when mass alone is fixed. Assembly bias must reflect a correlation
of environment with aspects of halo assembly which are not encoded in either of
these parameters. It induces effects which could compromise precision
measurements of cosmological parameters from large galaxy surveys.
