Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Hash value generation times Expand / Collapse
Author
Message
Posted Monday, March 11, 2013 9:16 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Tuesday, August 26, 2014 3:26 AM
Points: 708, Visits: 3,287
I have a table with 56 million rows. I performed the following operation:

ALTER TABLE MyBigTable ADD NewHashColumn AS HASHBYTES('SHA2_512', Column1+Column2+Column3)

The operation took a fraction of a second to complete. How is this possioble?! I mean can SQL Server really generate so many hash keys in such space of time?!

I'm guessing that the table was already in memory and all this operation took place in memory? Will the next checkpoint write the actual hash codes to the disk?


---------------------------------------------------------


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
Post #1429334
Posted Monday, March 11, 2013 10:17 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, August 28, 2014 2:20 PM
Points: 541, Visits: 1,047
If I were to guess from my limited knowledge of Hashbytes that this is treated like a computed column and doesn't actually store anything, only returning a value on select.
Post #1429375
Posted Monday, March 11, 2013 10:20 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Tuesday, August 26, 2014 3:26 AM
Points: 708, Visits: 3,287
That makes perfect sense. Thanks for the clarification.

---------------------------------------------------------


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
Post #1429379
Posted Tuesday, March 12, 2013 5:48 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:03 PM
Points: 7,099, Visits: 12,608
If you had added PERSISTED when adding the computed column there is a possibility you might still be waiting for that complete

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1429703
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse