Improve write streams performance and handling of joins