On Fri, May 14, 2004 at 04:29:29PM -0500, Dan Nelson wrote:
> In the last episode (May 14), Jeremy Zawodny said:
> > On Fri, May 14, 2004 at 03:26:28PM -0500, Donny Simonton wrote:
> > > Actually, if you are using 4.1.1 optimize table does get passed to
> > > the slave. This is from the 4.1.1 change log.
> > >
> > > ANALYZE TABLE, OPTIMIZE TABLE, REPAIR TABLE, and FLUSH statements
> > > are now stored in the binary log and thus replicated to slaves.
> > > This logging does not occur if the optional NO_WRITE_TO_BINLOG
> > > keyword (or its alias LOCAL) is given. Exceptions are that FLUSH
> > > LOGS, FLUSH MASTER, FLUSH SLAVE, and FLUSH TABLES WITH READ LOCK
> > > are not logged in any case. For a syntax example, see section
> > > 220.127.116.11 FLUSH Syntax.
> > Ugh. That's the *default*?
> > Gee, that won't surprise anyone, I'm sure...
> I think not having the slaves optimize is more surprising. Slaves get
> the exact same insert/delete/update queries as the master, so why
> should only the master get its tables optimized?
Easy. In the case of ANALYZE, OPTIMIZE, or REPAIR one would generally
want to stagger their execution on slaves. Otherwise the exact same
tables are unavailable at the same time.
Jeremy D. Zawodny | Perl, Web, MySQL, Linux Magazine, Yahoo!
<Jeremy@stripped> | http://jeremy.zawodny.com/
[book] High Performance MySQL -- http://highperformancemysql.com/