Home > Archive > MySQL ODBC Connector > September 2005 > Adding index to a replication slave









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Adding index to a replication slave
Balazs Rauznitz

2005-09-27, 3:23 am


I have replication set up. Is it OK to alter one of the slaves and add
several indexes ? It did seem to work, but I'd like to be sure.

Thanks,

Balazs

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw

Jigal van Hemert

2005-09-27, 3:23 am

Balazs Rauznitz wrote:
> I have replication set up. Is it OK to alter one of the slaves and add
> several indexes ? It did seem to work, but I'd like to be sure.


Replication does nothing more or less than copying the queries that
alter the tables (inserts, updates, alter table, delete, etc.) to the
slave in the same order as they were executed on the master (it may be
technically a different story, but this illustrates the concept).

So, you can change the data or the database structure as much as you
want, but errors may occur if the queries fail somehow. Adding indexes
is okay as long as you don't add indexes that will cause duplicate key
errors (e.g. a UNIQUE index on a field that will not contain unique values).
Also, indexes may slow down the queries (more or less) because of the
extra execution time needed to update the indexes.

Regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw

Jigal van Hemert

2005-09-27, 3:23 am

Mysql Lists wrote:
> I'm hoping they get replication setup by "diffs", only sending the diffs
> that are tracked from the master.. replicated to the slave.. That would
> be sweet :)
>
>
> On 9/27/05, *Jigal van Hemert* <jigal@spill.nl <mailto:jigal@spill.nl>>
> wrote:
>
> Balazs Rauznitz wrote:
> and add
>
> Replication does nothing more or less than copying the queries that
> alter the tables (inserts, updates, alter table, delete, etc.) to the
> slave in the same order as they were executed on the master (it may be
> technically a different story, but this illustrates the concept).


Please reply to the list and not to me personally, so others can join
the thread :-)

Using "diffs" (I assume that you mean a set of records that were changed
since the previous moment of synchronisation) is not the way MySQL
replication works. The master 'simply' keeps a log of the modifying
queries it performed and the slave reads that log from time to time.
It's the simplest and safest way to replicate IMHO...

Regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw

SGreen@unimin.com

2005-09-27, 9:23 am

--=_alternative 00471CB385257089_=
Content-Type: text/plain; charset="US-ASCII"

Jigal van Hemert <jigal@spill.nl> wrote on 09/27/2005 03:35:59 AM:

> Mysql Lists wrote:
diffs[color=darkred]

would[color=darkred]

<mailto:jigal@spill.nl>>[color=darkred]
that[color=darkred]
the[color=darkred]
may be[color=darkred]
>
> Please reply to the list and not to me personally, so others can join
> the thread :-)
>
> Using "diffs" (I assume that you mean a set of records that were changed


> since the previous moment of synchronisation) is not the way MySQL
> replication works. The master 'simply' keeps a log of the modifying
> queries it performed and the slave reads that log from time to time.
> It's the simplest and safest way to replicate IMHO...
>
> Regards, Jigal.
>


Jigal is right, that's now how replication is currently works in MySQL.

The current process is called "Statement Based Replication" (SBR). The
developers are currently working the kinks out of "Row Based Replication"
(RBR) which I believe is what Balazs was asking for. Look for it as a
feature in 5.0 (or 5.1 I am not sure which tree I was lurking when I read
the code changes).

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
--=_alternative 00471CB385257089_=--
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com