Is there a .NET equivalent to SQL Server's newsequentialid()

前端 未结 10 2186
孤城傲影
孤城傲影 2020-12-02 10:47

We use GUIDs for primary key, which you know is clustered by default.

When inserting a new row into a table it is inserted at a random page in the table (because GUID

10条回答
  •  悲&欢浪女
    2020-12-02 11:24

    Perhaps a simple way to determine the order in which rows have been added would be to add an IDENTITY column to the table, avoiding the need to keep your GUIDS in order and hence avoiding the performance hit of maintaining a clustered index on the GUID column.

    I can't help but wonder how keeping these rows in order helps you when debugging. Could you expand that a bit?

提交回复
热议问题