Mar 2009

Shared connection mode = lightning speed

by Steve Wortham
This weekend I implemented a new feature and released it in Data Comparisons 0.9.2.13. If you establish connection "A", you'll now see a little red arrow that you can click to copy connection "A" onto connection "B". This will put Data Comparisons into a shared connection mode. Behind the scenes this affects performance in a big way. I'll try to explain...

Dual connection mode
When two separate database connections are established, Data Comparisons will actually pull the complete result set of each table you're comparing, then compare them in memory, and then show the differences.

Shared connection mode
When a single database connection is used, Data Comparisons will query the SQL server directly. In effect, the SQL server will do the bulk of the comparison and ONLY return the differences. Say for example you're comparing two tables with a million records each. If there are only 5 differences total, then all the SQL server will return are just those 5 rows. This has enormous performance benefits, especially when you're connecting to a server over the internet.

Conclusion
You should use dual connection mode only when you have to. In other words, when you're comparing data between two different physical servers, then you must use dual connections. Otherwise, click those little red or blue arrows to use shared connection mode.