On Wednesday, November 28, 2012 11:55:01 AM UTC-8, Gunnar Liljas wrote:
>
> It's very easy to justify the use of something that doesn't require 
> database roundtrips in order to retreive a new PK value. 
>

Gunnar,

I think you are talking about something different than what I am talking 
about.

What I am talking about: Using GUID PK's will KILL a database server. By 
this, I mean that your db server will run %50-1000 slower, purely because 
you chose to use GUID PK's. (In fact, when you start to have 100's millions 
of rows in tables, DB's in the 1+ tb zone, you will be in very big trouble.)

If that is OK with you: Great.

For me, it is not OK.

You talk about db round trip: 

Ideal? No. 

But let's get real for a minute: How many inserts/second does your app do? 
50? 100? 1000? 

In the 10-100 range, the double call is nothing at all. It has essentially 
zero impact on sql server. (each record is only actually inserted once...)

Compare this with using GUID's and literally doubling (or more -- in my db 
it is a 3x impact) the aggregate size of all indexes on the table (because 
that GUID gets copied into every darned index, not just the PK!) because 
you chose a guid PK.

-- This makes your db server required 3x or more RAM (compared to no guid) 
so it can load the indexes to do queries.
-- This makes your backups slower (lots more data)
-- This makes your reindex slower (because index size so large)
-- This makes ALL inserts slower (because indexes are so large)

This "two trips" thing is real. But when you really look at the full 
comparison, on a db that is half a tb or larger, the guid choice is simply 
choosing the death of your db.

Choose life!

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/FXvflwXcNwgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to