Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 232531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:01:31+00:00 2026-05-11T20:01:31+00:00

I in the process of designing a database for high volume data and I

  • 0

I in the process of designing a database for high volume data and I was wondering what datatype to use for the primary keys?

There will be table partitioning and the database will ultimatley be clustered and will be hot failover to alternative datacentres.

EDIT


Tables – think chat system for multiple time periods and multiple things to chat about with multiple users chatting about the time period and thing.

Exponential issues are what I am thinking about – ie something could generate billions of rows in small time period. ie before we could change the database or DBA doing DBA things

Mark – I share your concearn of GUID – I dont like coding with GUIDs flying about.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:01:32+00:00Added an answer on May 11, 2026 at 8:01 pm

    With just the little bit of info you’ve provided, I would recommend using a BigInt, which would take you up to 9,223,372,036,854,775,807, a number you’re not likely to ever exceed. (Don’t start with an INT and think you can easily change it to a BigInt when you exceed 2 billion rows. Its possible (I’ve done it), but can take an extremely long time, and involve significant system disruption.)

    Kimberly Tripp has an Excellent series of blog articles (GUIDs as PRIMARY KEYs and/or the clustering key and The Clustered Index Debate Continues) on the issue of creating clustered indexes, and choosing the primary key (related issues, but not always exactly the same). Her recommendation is that a clustered index/primary key should be:

    1. Unique (otherwise useless as a key)
    2. Narrow (the key is used in all non-clustered indexes, and in foreign-key relationships)
    3. Static (you don’t want to have to change all related records)
    4. Always Increasing (so new records always get added to the end of the table, and don’t have to be inserted in the middle)

    If you use a BigInt as an increasing identity as your key and your clustered index, that should satisfy all four of these requirements.

    Edit: Kimberly’s article I mentioned above (GUIDs as PRIMARY KEYs and/or the clustering key) talks about why a (client generated) GUID is a bad choice for a clustering key:

    But, a GUID that is not sequential –
    like one that has it’s values
    generated in the client (using .NET)
    OR generated by the newid() function
    (in SQL Server) can be a horribly bad
    choice – primarily because of the
    fragmentation that it creates in the
    base table but also because of its
    size. It’s unnecessarily wide (it’s 4
    times wider than an int-based identity
    – which can give you 2 billion (really, 4 billion) unique rows). And,
    if you need more than 2 billion you
    can always go with a bigint (8-byte
    int) and get 263-1 rows.

    SQL has a function called NEWSEQUENTIALID() that allows you to generate sequential GUIDs that avoid the fragmentation issue, but they still have the problem of being unnecessarily wide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're in the process of designing a tiny database that will contain data regarding
I am currently in the process of designing a database. I have a table
I am currently in the process of designing a system which will use multiple
My team is in the process of designing a domain model which will hide
I'm in the process of designing my database and one of the Tables (Tasks),
I'm currently in the process of designing the database tables for a customer &
I'm in the process of designing a new database for an application. I'd like
I am currently in the process of designing myself a database driven website. The
I'm in the process of designing a small website and was curious when an
I am in a process of designing a custom SharePoint application. On a previous

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.