• Eric M Russell (1/10/2012)


    The thing about querying remote tables, especially when joining remote tables with local tables, is that the performance impact of the SQL coding tequnique is critical. I'm not sure that using synonymns to abstractly swap out a reference to a local table versus a remote table would result in the most efficient SQL, and it may often result in a very poor query performance. So even when the time comes to point that synonymn to a remote table on another instance, the developer may end up having to go back and re-code the structure of the SQL code anyhow. The usage of synonymns may actually obfuscate the underlying problem and make refactoring harder, because when reviewing the SQL code, it looks like only local tables are being referenced.

    I think that this is a valid point, however, I would guess that the opposite is most likely to be true i.e. that the code will assume a remote server using a particular synonym but in non-production environments it may happen to be changed to a local database.

    As always, it is about a smart team knowingly using a feature appropriately as opposed to a team using a smart feature.

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!