SQL Server - 同义词Tips&技巧? [英] SQL Server - Synonyms Tips & Tricks?

查看:144
本文介绍了SQL Server - 同义词Tips&技巧?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我一直在做很多的DB重构,同义词已经非常有用了。当我原来放在同义词里,我在想,当我重构时,他们会很临时。现在我想可能有一些很好的理由来保留这些同义词。




  • 有没有人把它们当成全部打击
    抽象层?


  • 性能成本是多少?


  • 带有索引的问题


  • 提示或技巧




我的第一个问题,请温柔。



谢谢

解决方案

同义词是一个抽象/替代名称对于已存在的数据库对象,在表的情况下,索引行为与底层对象的行为相同,即生成执行计划时,将生成相同的计划,而不考虑使用表名或对应的同义词。


I've been doing a lot of DB refactoring lately and synonyms have come in incredibly useful. When I originally put in the synonyms I was thinking they would be very temporary while I refactor. Now I am thinking there might be some good reasons to keep some of these synonyms around.

  • Has anyone used them as full blow abstraction layer?

  • What are the performance costs?

  • Any gotchas with indexes?

  • Tips or Tricks?

My first question, so please be gentle.

Thanks

解决方案

As a synonym is an abstraction/alternative name for an already existing database object, in the case of a table, index behaviour is identical to that of the underlying object i.e. when execution plans are generated, the same plan is generated irrespective of using the table name or corresponsing synonym.

这篇关于SQL Server - 同义词Tips&技巧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆