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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:54:11+00:00 2026-05-13T17:54:11+00:00

Currently our database has size 10 GB and is growing by around 3 GB

  • 0

Currently our database has size 10 GB and is growing by around 3 GB per month. Often I hear that one should from time to time rebuild the indexes, to improve the query execution time. So how often should I rebuild the indexes in the given scenario?

  • 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-13T17:54:11+00:00Added an answer on May 13, 2026 at 5:54 pm

    There’s a general consensus that you should reorganize ("defragment") your indices as soon as index fragmentation reaches more than 5 (sometimes 10%), and you should rebuild them completely when it goes beyond 30% (at least that’s the numbers I’ve heard advocated in a lot of places).

    Michelle Ufford (a.k.a. "SQL Fool") has an automated index defrag script, which uses those exact limits for deciding when to reorganize or rebuild an index.

    Also see Brad McGehee’s tips on rebuild indexes with some good thoughts and tips on how to deal with index rebuilding.


    I use this script here (can’t remember when I got this from – whoever it was: many thanks! Really helpful stuff) to display the index fragmentation on all your indices in a given database:

    SELECT 
        t.NAME 'Table name',
        i.NAME 'Index name',
        ips.index_type_desc,
        ips.alloc_unit_type_desc,
        ips.index_depth,
        ips.index_level,
        ips.avg_fragmentation_in_percent,
        ips.fragment_count,
        ips.avg_fragment_size_in_pages,
        ips.page_count,
        ips.avg_page_space_used_in_percent,
        ips.record_count,
        ips.ghost_record_count,
        ips.Version_ghost_record_count,
        ips.min_record_size_in_bytes,
        ips.max_record_size_in_bytes,
        ips.avg_record_size_in_bytes,
        ips.forwarded_record_count
    FROM 
        sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, 'DETAILED') ips
    INNER JOIN  
        sys.tables t ON ips.OBJECT_ID = t.Object_ID
    INNER JOIN  
        sys.indexes i ON ips.index_id = i.index_id AND ips.OBJECT_ID = i.object_id
    WHERE
        AVG_FRAGMENTATION_IN_PERCENT > 0.0
    ORDER BY
        AVG_FRAGMENTATION_IN_PERCENT, fragment_count
        
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our database is currently at 64 Gb and one of our apps started to
We have a query that is currently killing our database and I know there
We're currently migrating our database back-end from Firebird to PostgreSQL. We use NHibernate as
We have a database that is currently 1.5TB in size and grows by a
In our system our database looks like this One agency has many brokerages, one
Our database currently has CreatedByUser, CreatedTime, ModifiedByUser, Modified Time, Status and Description for all
Currently in our database the date field is entered as a string (ex: 11/7/2009).
Our database currently doesn't define primary keys on any tables. All of the id
I currently am pulling menu data out of our database using the PDO fetchAll()
Our company currently has seven dedicated SQL Server 2008 servers each running an average

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.