473,509 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

6GB 2 row table????

After running:

SELECT [total size KB], B.rows, O.name
FROM (select sum(convert(decimal(10,0),dpages)*8129/1024)
[total size KB], id
FROM sysindexes group by id)
A INNER JOIN sysindexes B ON A.id = B.id and B.indid in (0,1)
INNER JOIN sysobjects O ON B.id = O.id WHERE B.rows <> 0
ORDER BY [total size KB] desc

I receive a list of tables in the database and their size. However, at
the top of the list is a table that reports a size of 6295974.007811
KB... this table contains exactly 2 rows of information.. (whereas the
next largest table ~3GB contains 1.5million). This 2 row table total
size can't be right... can it?

I have created a backup of the entire table in order to try and delete
the data in that table.. and/or delete the entire table to see if my
database decreases by a substaintial amount.. I really am fairly new to
SQL and think even if I delete the entire table and recreate it.. I am
going to lose something (dependencies, SP, etc.. etc.)
Any suggestions are VERY appreciated.

Jul 23 '05 #1
3 1506

"hobbzilla" <ho*******@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
After running:

SELECT [total size KB], B.rows, O.name
FROM (select sum(convert(decimal(10,0),dpages)*8129/1024)
[total size KB], id
FROM sysindexes group by id)
A INNER JOIN sysindexes B ON A.id = B.id and B.indid in (0,1)
INNER JOIN sysobjects O ON B.id = O.id WHERE B.rows <> 0
ORDER BY [total size KB] desc

I receive a list of tables in the database and their size. However, at
the top of the list is a table that reports a size of 6295974.007811
KB... this table contains exactly 2 rows of information.. (whereas the
next largest table ~3GB contains 1.5million). This 2 row table total
size can't be right... can it?

I have created a backup of the entire table in order to try and delete
the data in that table.. and/or delete the entire table to see if my
database decreases by a substaintial amount.. I really am fairly new to
SQL and think even if I delete the entire table and recreate it.. I am
going to lose something (dependencies, SP, etc.. etc.)
Any suggestions are VERY appreciated.


The information in sysindexes may be wrong - check out DBCC UPDATEUSAGE in
Books Online. If that doesn't change anything, then you can use DBCC CHECKDB
to see if there's any database corruption which might explain it.

Simon
Jul 23 '05 #2
hobbzilla (ho*******@hotmail.com) writes:
SELECT [total size KB], B.rows, O.name
FROM (select sum(convert(decimal(10,0),dpages)*8129/1024)
[total size KB], id
FROM sysindexes group by id)
A INNER JOIN sysindexes B ON A.id = B.id and B.indid in (0,1)
INNER JOIN sysobjects O ON B.id = O.id WHERE B.rows <> 0
ORDER BY [total size KB] desc

I receive a list of tables in the database and their size. However, at
the top of the list is a table that reports a size of 6295974.007811
KB... this table contains exactly 2 rows of information.. (whereas the
next largest table ~3GB contains 1.5million). This 2 row table total
size can't be right... can it?


Unfortunately it can. If the table does not have a clustered index and
there are frequent inserts and deletes, then this result in huge
fragmentation.

But it could well be as Simon says, that DBCC UPDATEUSAGE will correct
the numbers.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3
For heap, delete can leave empty pages behind. So it is possible to have a
table with 6GB but only 2 rows.

Although the row/page count in sysindexes are not 100% accurately
maintained, it shouldn't go off by that much.

If DBCC UPDATEUSAGE doesn't help:

If this is a heap, you can reclaim the space back by create a clustered
index on the heap and drop it to get back the heap.
If this is an clustered index, rebuild the index will do.

--
Gang He
Software Design Engineer
Microsoft SQL Server Storage Engine

This posting is provided "AS IS" with no warranties, and confers no rights.
"hobbzilla" <ho*******@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
After running:

SELECT [total size KB], B.rows, O.name
FROM (select sum(convert(decimal(10,0),dpages)*8129/1024)
[total size KB], id
FROM sysindexes group by id)
A INNER JOIN sysindexes B ON A.id = B.id and B.indid in (0,1)
INNER JOIN sysobjects O ON B.id = O.id WHERE B.rows <> 0
ORDER BY [total size KB] desc

I receive a list of tables in the database and their size. However, at
the top of the list is a table that reports a size of 6295974.007811
KB... this table contains exactly 2 rows of information.. (whereas the
next largest table ~3GB contains 1.5million). This 2 row table total
size can't be right... can it?

I have created a backup of the entire table in order to try and delete
the data in that table.. and/or delete the entire table to see if my
database decreases by a substaintial amount.. I really am fairly new to
SQL and think even if I delete the entire table and recreate it.. I am
going to lose something (dependencies, SP, etc.. etc.)
Any suggestions are VERY appreciated.

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6576
by: Gaz | last post by:
Hi, I need to have a table nested within another table. The tables are alongside each other visually speaking, and the nested table (on the right) can vary in size. My problem is that when the...
61
24397
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
3
11347
by: Terrence Brannon | last post by:
I don't know what Postgres considers a relation and had no intention of creating one when piping my schema to it... I always DROP TABLE before CREATE TABLE, so here are the ERRORS emitted when...
4
15797
by: maricel | last post by:
I have the following base table structure - DDL: CREATE TABLE "ADMINISTRATOR"."T1" ( "C1" INTEGER NOT NULL ) IN "TEST_TS" ; ALTER TABLE "ADMINISTRATOR"."T1" ADD PRIMARY KEY
4
548
by: Simone Battagliero | last post by:
I wrote a program which inserts and finds elements in an hash table. Each element of the table is a dinamic list, which holds all elements having the same hash value (calculated by an int...
117
18411
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
76
271459
MMcCarthy
by: MMcCarthy | last post by:
Normalisation is the term used to describe how you break a file down into tables to create a database. There are 3 or 4 major steps involved known as 1NF (First Normal Form), 2NF (Second Normal...
7
4797
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
5
3816
by: wugon.net | last post by:
question: db2 LUW V8 UNION ALL with table function month() have bad query performance Env: db2 LUW V8 + FP14 Problem : We have history data from 2005/01/01 ~ 2007/05/xx in single big...
5
4902
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.