Statement based replication 我理解,将master执行的语句传给slave执行!实现同步!Row based replication是什么原理实现的呢?之所以这么问,是因为我现在遇到的一个问题,我在不同的slave上建立不同的索引以满足不同的应用需求,
如果用Statement based replication的话,当遇到一些delete或update语句时,由于相关索引的缺失,
会导致这些写操作每次都进行全表扫描以完成操作!非常耗时耗资源!不知道 Row based replication 能否解决我的问题!

解决方案 »

  1.   

    Row based replication是什么原理实现的呢?
    直接记录修改后的行 -> 然后把修改后的行同步到slave中使用Row based replication您下面这个问题就不会有影响了哈
    当遇到一些delete或update语句时,由于相关索引的缺失,
    会导致这些写操作每次都进行全表扫描以完成操作!非常耗时耗资源!
      

  2.   


    也就是说插入binlog的记录不是sql语句而是内容?删除呢?delete和update的话不也需要定位slave上数据表的位置吗?如何做到的?
      

  3.   

    http://dev.mysql.com/doc/refman/5.1/en/replication-sbr-rbr.html
    •RBR tends to generate more data that must be logged. To replicate a DML statement (such as an UPDATE or DELETE statement), statement-based replication writes only the statement to the binary log. By contrast, row-based replication writes each changed row to the binary log. If the statement changes many rows, row-based replication may write significantly more data to the binary log; this is true even for statements that are rolled back. This also means that taking and restoring from backup can require more time. In addition, the binary log is locked for a longer time to write the data, which may cause concurrency problems.