Primary Key Sorting

后端 未结 7 654
醉话见心
醉话见心 2020-12-16 03:48

Is a table intrinsically sorted by it\'s primary key? If I have a table with the primary key on a BigInt identity column can I trust that queries will always return the dat

7条回答
  •  无人及你
    2020-12-16 04:31

    In SQL Server: no, by it's clustering key - which default to the primary key, but doesn't have to be the same.

    The primary key's main function is to uniquely identify each row in the table - but it doesn't imply any (physical) sorting per se.

    Not sure about the other database systems.

    Marc

提交回复
热议问题