Re: why default index for primary key is clustered?

From: Joe Celko (jcelko212_at_earthlink.net)
Date: 08/18/04


Date: Tue, 17 Aug 2004 19:08:46 -0700


>> So why SQL Server created clustered index by default for primary key
which is always unique? It seems to be a bad default design .. <<

History, not logic. When you had sequential tape files, you had to sort
them on the record keys. A master tape would be read in sorted order
against a transaction tape in that same order. All data processing was
based on merging these tapes back them.

So when we got disk and random access, we kept the old model! The
underlying file structure in SQL Server is still physically contigous
storage records, and tables based on separate files. This is not true
in newer SQL engines.

--CELKO--
 ===========================
 Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: backup Keys
    ... "Back up the SQL Server 2005 encryption keys by using the corresponding SQL ... Regarding on the symmetric and asymmetric keys in SQL Server 2005 database, ...
    (microsoft.public.sqlserver.security)
  • Re: Why is this Not Updatable?
    ... have a Memo field. ... are there proper keys established on the SQL Server ... > warning that no changes can be made), do the primary key columns ...
    (microsoft.public.access.queries)
  • Re: Why is this Not Updatable?
    ... Bill To Info field instead of the BillToID field. ... are there proper keys established on the SQL Server ... > warning that no changes can be made), do the primary key columns ...
    (microsoft.public.access.queries)
  • Re: Cannot backup to tape
    ... Does the SQL NT login have read/write permissions on the TAPE drive... ... I support the Professional Association of SQL Server and it's community of SQL Server professionals. ... > We copied our database to a new server (windows 2000> server to windows server 2003). ... > On the new server when i try to backup to a tape i got> this error message. ...
    (microsoft.public.sqlserver.server)
  • Re: Cannot backup to tape
    ... >I support the Professional Association of SQL Server ... >> Can some one please help me with this backup error. ... >> On the new server when i try to backup to a tape i got ...
    (microsoft.public.sqlserver.server)