SQL Total_pages space is very high than the used_pages

Racheal 226 Reputation points
2023-01-31T10:33:00.3766667+00:00

Hi ,

For an Archival process we have swithced out a partition to a new table . but this table Totalpages used space is very high compare to the usedpages.

what could be the reason for alocated_memory space is too high ?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,756 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 101.4K Reputation points MVP
    2023-02-01T22:04:58.3333333+00:00

    I doubt that DBCC UPDATEUSAGE will change this. This command could be needed in the dim and distant past of SQL 2000 and older versions.

    Why the difference is that big is difficult to say, without a full repro of how you arrived there. But one possibility is that you loaded data with a minimally logged operation, and only a few rows at a time. Every new transaction will start with a new extent.

    You say that this table used to be a partition in the old table. So another possibility is that data has been deleted and updated, leaving lots of empty space in it.

    In any case, it is not the partition switching that cause this difference - it was there in partitioned table as well.

    You could rebuild the indexes to compact the table.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Olaf Helper 40,901 Reputation points
    2023-01-31T10:58:00.54+00:00

  2. Racheal 226 Reputation points
    2023-02-01T06:03:29.9633333+00:00

    Hi,

    any updates on my question ?

    What will happen to the used space and allocated space once the table is dropped ? Will that be free ?