home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 17,721 of 19,505   
   Erland Sommarskog to vardan.hakopian@gmail.com   
   Re: indexes and constraints   
   14 Dec 09 22:54:29   
   
   b5b98864   
   From: esquel@sommarskog.se   
      
   hayko98 (vardan.hakopian@gmail.com) writes:   
   > I am inserting data into 3 tables. Before I insert, I am dropping some   
   > of the constrains. After   inserting the data I added dropped   
   > constrains back .Most of the constraints that I added I did not   
   > specify WITH CHECK or WITH NOCHECK.5 Of them I used WITH NOCKECK.My   
   > question is how would this adding and dropping constrains effect to   
   > indexes and performence?.Do I have to reindex them?   
      
   When it comes to UNIQUE and PRIMARY KEY constraints, NOCHECK has no   
   effect.   
      
   For FOREIGN KEYS and CHECK constraints, using NOCHECK means that SQL   
   Server does not verify that data in the table complies with the constraint.   
   This has the implication that the optimizer cannot trust the constraint,   
   and this could have an impact on performance.   
      
      
   --   
   Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se   
      
   Links for SQL Server Books Online:   
   SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx   
   SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx   
   SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca