Thanks Peter, it makes sense that limiting the number of rows in the tally table makes it faster. I'm just surprised the "Where len(value) <= tally.N" did not make it faster, but I guess this is ok.
By the way, thanks for the help all, I've been able to identify the weird characters in the table, and we'll choose which character we do not want anymore.
Thanks again,
Cheers,
J-F