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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:12:43+00:00 2026-05-15T03:12:43+00:00

I’m using SQL Server 2005. I have a table whose row size should be

  • 0

I’m using SQL Server 2005.

I have a table whose row size should be 124 bytes. It’s all ints or floats, no NULL columns (so everything is fixed width).

There is only one index, clustered. The fill factor is 0.

Here’s the table def:

create table OHLC_Bar_Trl
(
    obt_obh_id int NOT NULL REFERENCES OHLC_Bar_Hdr (obh_id),
    obt_bar_start_ms int NOT NULL,
    obt_bar_end_ms int NOT NULL,
    obt_last_price float NOT NULL,
    obt_last_ms int NOT NULL,
    obt_bid_price float NOT NULL,
    obt_bid_size int NOT NULL,
    obt_bid_ms int NOT NULL,
    obt_bid_pexch_price float NOT NULL,
    obt_ask_price float NOT NULL,
    obt_ask_size int NOT NULL,
    obt_ask_ms int NOT NULL,
    obt_ask_pexch_price float NOT NULL,
    obt_open_price float NOT NULL,
    obt_open_ms INT NOT NULL,
    obt_high_price float NOT NULL,
    obt_high_ms INT NOT NULL,
    obt_low_price float NOT NULL,
    obt_low_ms INT NOT NULL,
    obt_volume float NOT NULL,
    obt_vwap float NOT NULL
)
go

create unique clustered index idx on OHLC_Bar_Trl (obt_obh_id,obt_bar_end_ms)

After inserting a ton of data, sp_spaceused returns the following

name            rows        reserved           data               index_size         unused
OHLC_Bar_Trl    117076054   29807664 KB        29711624 KB        92344 KB           3696 KB

which shows a rowsize of approx (29807664*1024)/117076054 = 260 bytes/row.

Where’s the rest of the space?

Is there some DBCC command I need to run to tighten up this table (I could not insert the rows in correct index order, so maybe it’s just internal fragmentation)?

  • 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-15T03:12:43+00:00Added an answer on May 15, 2026 at 3:12 am

    You can use sys.dm_db_index_physical_stats to get pretty detailed information on how data is stored in a given table. It’s not the clearest thing to use, here’s the template I built up over time for my first pass on troubleshooting:

    --  SQL 2005 - fragmentation & air bubbles
     SELECT
       ob.name [Table], ind.name [Index], ind.type_desc IndexType
      ,xx.partition_number      PartitionNo
      ,xx.alloc_unit_type_desc  AllocationTyp
      ,xx.index_level
      ,xx.page_count        Pages
      ,xx.page_count / 128  Pages_MB
      ,xx.avg_fragmentation_in_percent  AvgPctFrag
      ,xx.fragment_count
      ,xx.avg_fragment_size_in_pages  AvgFragSize
      ,xx.record_count      [Rows]
      ,xx.forwarded_record_count  [ForwardedRows]
      ,xx.min_record_size_in_bytes        MinRowBytes
      ,xx.avg_record_size_in_bytes        AvgRowBytes
      ,xx.max_record_size_in_bytes        MaxRowBytes
      ,case xx.page_count
         when 0 then 0.0
         else xx.record_count / xx.page_count
       end AvgRowsPerPage
      ,xx.avg_page_space_used_in_percent  AvgPctUsed
      ,xx.ghost_record_count
      ,xx.version_ghost_record_count
     from sys.dm_db_index_physical_stats
       (
         db_id('MyDatabase')
        ,object_id('MyTable')
        ,null
        ,null
        ,'Detailed'
       ) xx
      inner join sys.objects ob
       on ob.object_id = xx.object_id
      inner join sys.indexes ind
       on ind.object_id = xx.object_id
        and ind.index_id = xx.index_id
    

    Use this to check if SQL thinks the row is as long as you think it is, or if there’s extra space being used/wasted somewhere.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't

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.