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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:10:40+00:00 2026-05-23T15:10:40+00:00

What is the formula to figure out how much space an index will need

  • 0

What is the formula to figure out how much space an index will need to be created ?

IMPORTANT: We are using sql server express 2005. So 4GB is the limit. Hence this question.
Unrestricted Autogrow of log files is not an option. t-sql psuedo code below will explain further.

int spaceNeeded = 
  FN_COMPUTE_SPACE_NEEDED_TO_CREATE_UNCLUSTERED_INDEX(MyTableName, MyColumnName)

It’s the one function above that I am stuck at while coding this stored proc
I think I can handle all the below with info available on msdn etc.

While(GetDBSpaceAvailable() < spaceNeeded )
{
    purge some data (go thru all tables and delete data logically)
}

create the index we need
CREATE NONCLUSTERED INDEX [IX_NonClustered_MyTable] ON [dbo].[MyTable]
(   [MyColumn] ASC
)

Any pointers appreciated in this regards. Hoping this is a repeat but could not find anything when I searched.
thank you

UPDATE: Solution that worked for me uses Aaron’s suggestion. (additional 1.2X over and above the space the index occupies now). So basically I purge oldest data until space available is 1.2 to 1.5x over and above the current index size reported by sp_spaceused tablename. Then create the index.

  • 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-23T15:10:41+00:00Added an answer on May 23, 2026 at 3:10 pm

    The size limit is only per database. Have you considered putting some of your junk, static or at least less volatile data into a separate database? You can create synonyms to make it so that the code doesn’t realize some of the data is in its own 4GB space. All on one instance you’d be hard-pressed to notice any performance difference by splitting it up, the biggest problem would be backup consistency as you’d be backing up the data separately. But it would be one way to avoid your index space requirements.

    Also, instead of using this old version of SQL Server 2005 Express, why not move to the most recent released version (SQL Server 2008 R2), where you have 6 more GB to play with (database size is limited to 10 GB instead of 4 GB). In addition you get some new features, T-SQL syntax and performance benefits.

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

Sidebar

Related Questions

Trying to figure out how to write a jquery formula that will sum all
we have an interesting formula to figure out. First, we count the following, where
What's a good estimate/conversion/formula to figure out X# characters = Y# bytes?
I can't figure out the formula to compute the bank (roll) angle from the
This should be a simple formula but I can not figure it out. I
I've been trying to find a formula to figure out if a car is
I'm trying to figure out what this formula does, I've read what sumproduct does
I'm having trouble trying to figure out arithmetic progressions. I'm looking for a formula
I am trying to create a application that will figure out how to find
Is there any algorithm/formula that can help me to figure out natural dimensions of

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.