GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Data Warehousing
Go To First  |  Previous Question  |  Next Question 
 Data Warehousing  |  Question 14 of 92    Print  
how many clustered indexes can u create for a table in DWH?
In case of truncate and delete commanda what happens to table which has unique id.

  
Total Answers and Comments: 3 Last Update: December 04, 2007     Asked by: lavanya 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 22, 2006 10:34:01   #1  
opbang Member Since: March 2006   Contribution: 46    

RE: how many clustered indexes can u create for a tabl...

You can have only one clustered index per table.

If you use delete command, you can rollback... it fills your redo log files.

If you do not want records, you may use truncate command... which will be faster... and doesn't fill your redo log files.


 
Is this answer useful? Yes | No
July 09, 2007 10:11:52   #2  
Hakoonamatata Member Since: July 2007   Contribution: 5    

RE: how many clustered indexes can u create for a tabl...
By definition, a clustered index  physically arranges all data in a table in a sequential manner. Since you can not have more than one physical arrangements of data in a table, you can have just one clustered index per table.

In case of truncate, all data is deleted without any transaction log entry, hence the unique ID can have the same values again, while in case of delete, the unique ID will have newer values in the new data load.

 
Is this answer useful? Yes | No
December 04, 2007 16:29:37   #3  
ecoverdale Member Since: December 2007   Contribution: 1    

RE: how many clustered indexes can u create for a table in DWH?In case of truncate and delete commanda what happens to table which has unique id.
In SQL Server terms:

Only one clustered index is permitted on a table.

When a delete statement is performed it is a logged transaction which can be rolled back.  The delete does nothing to the identity column of the table. 

A truncate is also logged and can be rolledback.  The truncate will reset the identity column. 

The big difference between delete and truncate is that the delete statement records individual row deletes in the transaction log while the truncate records data page deallocations.  The rollback ability of a truncate is pretty easy to verify with a simple test.  Begin a transaction, truncate a table that you know has records, and rollback the transaction.  This test is best done with test tables!

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape