What are the performance improvement of Sequential Guid over standard Guid? [closed]

GUID vs.Sequential GUID A typical pattern it’s to use Guid as PK for tables, but, as referred in other discussions (see Advantages and disadvantages of GUID / UUID database keys) there are some performance issues. This is a typical Guid sequence f3818d69-2552-40b7-a403-01a6db4552f7 7ce31615-fafb-42c4-b317-40d21a6a3c60 94732fc7-768e-4cf2-9107-f0953f6795a5 Problems of this kind of data are:< – Wide distributions of … Read more

Using Rails, how can I set my primary key to not be an integer-typed column?

Unfortunately, I’ve determined it’s not possible to do it without using execute. Why it doesn’t work By examining the ActiveRecord source, we can find the code for create_table: In schema_statements.rb: def create_table(table_name, options={}) … table_definition.primary_key(options[:primary_key] || Base.get_primary_key(table_name.to_s.singularize)) unless options[:id] == false … end So we can see that when you try to specify a primary … Read more

What are the best practices for using a GUID as a primary key, specifically regarding performance? [closed]

GUIDs may seem to be a natural choice for your primary key – and if you really must, you could probably argue to use it for the PRIMARY KEY of the table. What I’d strongly recommend not to do is use the GUID column as the clustering key, which SQL Server does by default, unless … Read more