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 928677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:02:58+00:00 2026-05-15T20:02:58+00:00

For you database design/performance gurus out there. I’m designing a table, I have the

  • 0

For you database design/performance gurus out there.

I’m designing a table, I have the choice of either use int or nvarchar (128) for a column, assume space is not a problem. My question is which will give performance

when I search with int column

where ID = 12324

or when I search with nvarchar column (the Key is the entire value, so I’m not using LIKE operator)

where Key = 'my str'

I’m sure for smaller datasets it doesn’t matter, but let’s assume this data will be in the millions of rows.

  • 1 1 Answer
  • 1 View
  • 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-15T20:02:59+00:00Added an answer on May 15, 2026 at 8:02 pm

    INT will be faster – here’s why:

    • SQL Server organizes its data and index into pages of 8K
    • if you have an index page with INT key on it, you get roughly 2’000 INT entries
    • if you have NVARCHAR(128) and you use on average 20 characters, that’s 40 bytes per entry, or roughly 200 entries per page

    So for the same amount of index entries, the NVARCHAR(128) case would use ten times as many index pages.

    Loading and searching those index pages will incur significantly more I/O operations.

    So to make things short: if you can, always use INT .

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

Sidebar

Related Questions

For you database design/performance gurus out there. If you have a database that is
I have the following database design: Employee Table: Username, Name, DivisionCode Division Table: SapCode,
I have the following database design: Employee Table: Username, Name Quiz Table: QuizID, Title,
I have a question regarding DataBase design. I have a Entity Table named: CARS
I have a database design that makes use of compound primary keys to ensure
I have troubles with the following database design (simplified for the example). It allows
Let's say i have a database design like this: for the data: id |
I have a general Database Design question: When is it better to create a
I have a question re: performance and design. Crux of the problem is: do
The re-design for a large database at our company makes extensive use of composite

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.