Greatly improved performance of replication selects in mysql

Now use proper indexes...