Showing posts with label estimate. Show all posts
Showing posts with label estimate. Show all posts

Thursday, March 29, 2012

Estimation of Full Backup size

Has anyone come across a more accurate method than sp_spaceused to estimate the size of a full database backup for SQL Server 2000 ?

I have found this to have too great a variance (even after running updateusage) to rely on any accuracy for it. I have also looked at perhaps using the ALLOCATED Pages indicated in the GAM pages but this also seems to be pretty inaccurate.

I have a number of servers where space can be limited and backups using Maintenance Plans have occasionally failed because they delete the old backups AFTER they do the latest one. I am writing a script which can check the space remaining and adjust the backup accordingly but the variance I have observed so far with sp_spaceused is too great.

Any ideas welcomed.

Full backups copy all pages within allocated extents. So, there may be a few pages which are not allocated, but which are copied to the backup. Also, there is a small percentage of overhead in the backup format, but this should be predictable.

The most accurate estimate would be to use updateusage and then look at the reserved column of sp_spaceused.

What is the variance that you are seeing? It should be fairly small.

The real bottom line is that if you have servers which you know occasionally run out of backup space, they need to have storage added so that you can ensure the safety of your databases. You can minimize the space requirements by compressing the backups and/or copying them off the server as soon as they are created, but you need the space there.

|||

Thanks for that Kevin

I need to do a few more tests to confirm the variance that I am seeing - it seemed to be inconsistent for a couple of databases (shooting up to 4MB) after being within about 85KB - 90KB for all of the others so there may have been something else happening.

You mention all pages within allocated extents - does that mean that I could use the GAM or SGAM pages to count the number of allocated extents and use this as an estimate? I already have a method of doing this for estimating differential backups using the DIFF_MAP pages.

Martin

|||

The other component of a backup is that the portion of the log created during the execution of the backup is also backed up. This is required in order to get a consistent view of the data at a single point in time.

Depending on the activity level and size of your database, this could easily account for this much variability and more.

Lets look at this from a different angle:

What are your business requirements around backups that are driving your backup plans? If we understand those, we can perhaps better optimize your strategy. I find that the best way to craft a backup strategy is to start from the recovery requirements and work backwards to come up with a plan which will support those needs.

What are the sizes of the databases you are backing up?

estimating tempdb usage

Is there any way to estimate how much space will be needed by tempdb?
I have a user executing a simple query similar to:
select orders.customerid, sum(quantity*unitprice) as amount
from orders inner join [order details]
on orders.orderid=[order details].orderid
group by orders.customerid
In other words, two thin (not too many columns) tables, equi-join,
summarizing and a group by. The only trouble is her two tables have
28000 rows and nearly 800 million rows. Her query dies after a few
hours when tempdb autogrows and runs out of disk space at 17 gig. I
know tempdb is used for work tables, joins, sorts, group bys, etc.
But knowing the columns sizes and number of rows, is there a way to
estimate how much tempdb will be needed? She's basically the only
user on the system.
By the way, this is SQL Server 2000.
Thanks,
ScottI guess it would be better to Grow the tempdb first, then run oyur query.
I had the same problem on SQL Server 6.5 to 2000 migration with the log
files (we had big tables as well) , the Autogrowth didn´t work. So we had to
create the database and transaction logs big enough to support migration
process before initiate it.
HTH
"scott parmelee" <s_parmelee@.hotmail.com> escreveu na mensagem
news:e14a8116.0311130819.725c0a4@.posting.google.com...
> Is there any way to estimate how much space will be needed by tempdb?
> I have a user executing a simple query similar to:
> select orders.customerid, sum(quantity*unitprice) as amount
> from orders inner join [order details]
> on orders.orderid=[order details].orderid
> group by orders.customerid
> In other words, two thin (not too many columns) tables, equi-join,
> summarizing and a group by. The only trouble is her two tables have
> 28000 rows and nearly 800 million rows. Her query dies after a few
> hours when tempdb autogrows and runs out of disk space at 17 gig. I
> know tempdb is used for work tables, joins, sorts, group bys, etc.
> But knowing the columns sizes and number of rows, is there a way to
> estimate how much tempdb will be needed? She's basically the only
> user on the system.
> By the way, this is SQL Server 2000.
> Thanks,
> Scott

Estimating Table Sizes

Is it possible to write a query that can estimate the space a table is
using in the database? I would like to be able to generate a report
that can display the amount of disk space a table is consuming.How about using sp_spaceused?
RLF
<marcusq71@.gmail.com> wrote in message
news:1173901596.189278.188470@.l75g2000hse.googlegroups.com...
> Is it possible to write a query that can estimate the space a table is
> using in the database? I would like to be able to generate a report
> that can display the amount of disk space a table is consuming.
>|||Hello,
Go to the specific database and execute the below command to get the space
usage for all tables individually.
EXEC sp_MSForEachTable 'EXEC sp_spaceused [?]';
Thanks
Hari
<marcusq71@.gmail.com> wrote in message
news:1173901596.189278.188470@.l75g2000hse.googlegroups.com...
> Is it possible to write a query that can estimate the space a table is
> using in the database? I would like to be able to generate a report
> that can display the amount of disk space a table is consuming.
>|||On Mar 15, 12:46 am, "marcus...@.gmail.com" <marcus...@.gmail.com>
wrote:
> Is it possible to write a query that can estimate the space a table is
> using in the database? I would like to be able to generate a report
> that can display the amount of disk space a table is consuming.
Make sure you run DBCC UPDATEUSAGE on the database before you run
sp_spaceused
Reports and corrects inaccuracies in the sysindexes table, which may
result in incorrect space usage reports by the sp_spaceused system
stored procedure.
M A Srinivas|||On Mar 15, 2:07 am, "M A Srinivas" <masri...@.gmail.com> wrote:
> On Mar 15, 12:46 am, "marcus...@.gmail.com" <marcus...@.gmail.com>
> wrote:
>
> Make sure you run DBCC UPDATEUSAGE on the database before you run
> sp_spaceused
> Reports and corrects inaccuracies in the sysindexes table, which may
> result in incorrect space usage reports by the sp_spaceused system
> stored procedure.
> M A Srin
Thank you all for these suggestions. This is exactly what I am
looking for. I was not clear on my initial request but the
MSforeachtable stored procedure was exactly what I was looking for.

Estimating Table Sizes

Is it possible to write a query that can estimate the space a table is
using in the database? I would like to be able to generate a report
that can display the amount of disk space a table is consuming.
How about using sp_spaceused?
RLF
<marcusq71@.gmail.com> wrote in message
news:1173901596.189278.188470@.l75g2000hse.googlegr oups.com...
> Is it possible to write a query that can estimate the space a table is
> using in the database? I would like to be able to generate a report
> that can display the amount of disk space a table is consuming.
>
|||Hello,
Go to the specific database and execute the below command to get the space
usage for all tables individually.
EXEC sp_MSForEachTable 'EXEC sp_spaceused [?]';
Thanks
Hari
<marcusq71@.gmail.com> wrote in message
news:1173901596.189278.188470@.l75g2000hse.googlegr oups.com...
> Is it possible to write a query that can estimate the space a table is
> using in the database? I would like to be able to generate a report
> that can display the amount of disk space a table is consuming.
>
|||On Mar 15, 12:46 am, "marcus...@.gmail.com" <marcus...@.gmail.com>
wrote:
> Is it possible to write a query that can estimate the space a table is
> using in the database? I would like to be able to generate a report
> that can display the amount of disk space a table is consuming.
Make sure you run DBCC UPDATEUSAGE on the database before you run
sp_spaceused
Reports and corrects inaccuracies in the sysindexes table, which may
result in incorrect space usage reports by the sp_spaceused system
stored procedure.
M A Srinivas
|||On Mar 15, 2:07 am, "M A Srinivas" <masri...@.gmail.com> wrote:
> On Mar 15, 12:46 am, "marcus...@.gmail.com" <marcus...@.gmail.com>
> wrote:
>
> Make sure you run DBCC UPDATEUSAGE on the database before you run
> sp_spaceused
> Reports and corrects inaccuracies in the sysindexes table, which may
> result in incorrect space usage reports by the sp_spaceused system
> stored procedure.
> M A Srin
Thank you all for these suggestions. This is exactly what I am
looking for. I was not clear on my initial request but the
MSforeachtable stored procedure was exactly what I was looking for.
sql

Estimating Table Sizes

Is it possible to write a query that can estimate the space a table is
using in the database? I would like to be able to generate a report
that can display the amount of disk space a table is consuming.How about using sp_spaceused?
RLF
<marcusq71@.gmail.com> wrote in message
news:1173901596.189278.188470@.l75g2000hse.googlegroups.com...
> Is it possible to write a query that can estimate the space a table is
> using in the database? I would like to be able to generate a report
> that can display the amount of disk space a table is consuming.
>|||Hello,
Go to the specific database and execute the below command to get the space
usage for all tables individually.
EXEC sp_MSForEachTable 'EXEC sp_spaceused [?]';
Thanks
Hari
<marcusq71@.gmail.com> wrote in message
news:1173901596.189278.188470@.l75g2000hse.googlegroups.com...
> Is it possible to write a query that can estimate the space a table is
> using in the database? I would like to be able to generate a report
> that can display the amount of disk space a table is consuming.
>|||On Mar 15, 12:46 am, "marcus...@.gmail.com" <marcus...@.gmail.com>
wrote:
> Is it possible to write a query that can estimate the space a table is
> using in the database? I would like to be able to generate a report
> that can display the amount of disk space a table is consuming.
Make sure you run DBCC UPDATEUSAGE on the database before you run
sp_spaceused
Reports and corrects inaccuracies in the sysindexes table, which may
result in incorrect space usage reports by the sp_spaceused system
stored procedure.
M A Srinivas|||On Mar 15, 2:07 am, "M A Srinivas" <masri...@.gmail.com> wrote:
> On Mar 15, 12:46 am, "marcus...@.gmail.com" <marcus...@.gmail.com>
> wrote:
> > Is it possible to write a query that can estimate the space a table is
> > using in the database? I would like to be able to generate a report
> > that can display the amount of disk space a table is consuming.
> Make sure you run DBCC UPDATEUSAGE on the database before you run
> sp_spaceused
> Reports and corrects inaccuracies in the sysindexes table, which may
> result in incorrect space usage reports by the sp_spaceused system
> stored procedure.
> M A Srin
Thank you all for these suggestions. This is exactly what I am
looking for. I was not clear on my initial request but the
MSforeachtable stored procedure was exactly what I was looking for.

estimating maximum row size

hi,
give a table definition, how can i estimate the maximum row size ?
eg:
table (a varchar(8000),
b varchar(100))
the row size (from the column lengths) is 8100, but actually it is more than
that.
i know that coz when i create the above table i get an error as:
Warning: The table 'size_test' has been created but its maximum row size
(8125) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE
of a row in this table will fail if the resulting row length exceeds 8060
bytes.
i would like to check against this limit. that is why i need the max row size.
thanks
--
Vivek T S
Member Technical Staff (Inucom)Hello,
Check the following link
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/architec/8_ar_ts_8dbn.asp which gives
the max size per row as 8060 bytes.
I would sugest you change your varchar to something like a
text for some other large object. The reason is that they
can store a lot more than 8060 and still be on the same
table as other fields.
Peter
"Happiness is nothing more than good health and a bad
memory."
Albert Schweitzer
>--Original Message--
> hi,
> give a table definition, how can i estimate the
maximum row size ?
> eg:
> table (a varchar(8000),
> b varchar(100))
>the row size (from the column lengths) is 8100, but
actually it is more than
>that.
>i know that coz when i create the above table i get an
error as:
>Warning: The table 'size_test' has been created but its
maximum row size
>(8125) exceeds the maximum number of bytes per row
(8060). INSERT or UPDATE
>of a row in this table will fail if the resulting row
length exceeds 8060
>bytes.
>i would like to check against this limit. that is why i
need the max row size.
>thanks
>--
>Vivek T S
>Member Technical Staff (Inucom)
>.
>sql

Estimating growth of mdf file size...

Hi, how can I estimate the mdf file size's growth as record inserted?

For a rough calculation you can calculate the sum of bytes needed for one row, e.g. Having a table with three CHAR(200) will need 600 bytes + additional overhead ~32 bytes. You can just sum up all the data types you have to get the row size in your table.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||Thank you for replying.

Then, what about the growth if the table has index column?|||You will have to add the size of the indexed columns in addition.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Tuesday, March 27, 2012

Estimating Disk Space

Thanks for your replies Tibor / John.
Is there any script/tool available to estimate the size of
the target database. I have the table structures and
estimated rows.
Thanks,
HariI believe that the book "Inside SQL Server 2000" from MS Press comes with such a tool. The book is a
"must" IMO for any intermediate/advanced SQL Server person anyhow, IMO... :-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hari Shankar" <anonymous@.discussions.microsoft.com> wrote in message
news:2429f01c45f3c$1f2b89c0$a401280a@.phx.gbl...
> Thanks for your replies Tibor / John.
> Is there any script/tool available to estimate the size of
> the target database. I have the table structures and
> estimated rows.
> Thanks,
> Harisql

Estimating DabaBase space growth

Hello! All.
I need to estimate a DataBase space growth, but I 've never had something
like that.
Anybody could help me wiht this?
Which informations a need to make this estimative?
Are there any rules or template to estimate it?
Thanks a lot
Juliano Horta
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums...erver/200603/1
Hi
In Books online there is a section on how to estimate the size of a database
under the Creating and Maintaining a database section. As a rougher measure
you could look at the current size and number of entries and just work with
averages. There are a couple of stored procedures on the accompanying discs
with Inside SQL Server 2000 by Kalen Delaney ISBN 0-7356-0998-5 that will
help.
John
"julianohorta via droptable.com" wrote:

> Hello! All.
> I need to estimate a DataBase space growth, but I 've never had something
> like that.
> Anybody could help me wiht this?
> Which informations a need to make this estimative?
> Are there any rules or template to estimate it?
> Thanks a lot
> Juliano Horta
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums...erver/200603/1
>
|||Hello!
Thank you very much
John Bell wrote:[vbcol=seagreen]
>Hi
>In Books online there is a section on how to estimate the size of a database
>under the Creating and Maintaining a database section. As a rougher measure
>you could look at the current size and number of entries and just work with
>averages. There are a couple of stored procedures on the accompanying discs
>with Inside SQL Server 2000 by Kalen Delaney ISBN 0-7356-0998-5 that will
>help.
>John
>[quoted text clipped - 8 lines]
Message posted via http://www.droptable.com

Estimating DabaBase space growth

Hello! All.
I need to estimate a DataBase space growth, but I 've never had something
like that.
Anybody could help me wiht this?
Which informations a need to make this estimative?
Are there any rules or template to estimate it?
Thanks a lot
Juliano Horta
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200603/1Hi
In Books online there is a section on how to estimate the size of a database
under the Creating and Maintaining a database section. As a rougher measure
you could look at the current size and number of entries and just work with
averages. There are a couple of stored procedures on the accompanying discs
with Inside SQL Server 2000 by Kalen Delaney ISBN 0-7356-0998-5 that will
help.
John
"julianohorta via droptable.com" wrote:

> Hello! All.
> I need to estimate a DataBase space growth, but I 've never had something
> like that.
> Anybody could help me wiht this?
> Which informations a need to make this estimative?
> Are there any rules or template to estimate it?
> Thanks a lot
> Juliano Horta
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200603/1
>|||Hello!
Thank you very much
John Bell wrote:[vbcol=seagreen]
>Hi
>In Books online there is a section on how to estimate the size of a databas
e
>under the Creating and Maintaining a database section. As a rougher measure
>you could look at the current size and number of entries and just work with
>averages. There are a couple of stored procedures on the accompanying discs
>with Inside SQL Server 2000 by Kalen Delaney ISBN 0-7356-0998-5 that will
>help.
>John
>
>[quoted text clipped - 8 lines]
Message posted via http://www.droptable.com

Estimating DabaBase space growth

Hello! All.
I need to estimate a DataBase space growth, but I 've never had something
like that.
Anybody could help me wiht this?
Which informations a need to make this estimative?
Are there any rules or template to estimate it?
Thanks a lot
Juliano Horta
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200603/1Hi
In Books online there is a section on how to estimate the size of a database
under the Creating and Maintaining a database section. As a rougher measure
you could look at the current size and number of entries and just work with
averages. There are a couple of stored procedures on the accompanying discs
with Inside SQL Server 2000 by Kalen Delaney ISBN 0-7356-0998-5 that will
help.
John
"julianohorta via SQLMonster.com" wrote:
> Hello! All.
> I need to estimate a DataBase space growth, but I 've never had something
> like that.
> Anybody could help me wiht this?
> Which informations a need to make this estimative?
> Are there any rules or template to estimate it?
> Thanks a lot
> Juliano Horta
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200603/1
>|||Hello!
Thank you very much
John Bell wrote:
>Hi
>In Books online there is a section on how to estimate the size of a database
>under the Creating and Maintaining a database section. As a rougher measure
>you could look at the current size and number of entries and just work with
>averages. There are a couple of stored procedures on the accompanying discs
>with Inside SQL Server 2000 by Kalen Delaney ISBN 0-7356-0998-5 that will
>help.
>John
>> Hello! All.
>[quoted text clipped - 8 lines]
>> Juliano Horta
--
Message posted via http://www.sqlmonster.com

Estimate time to populate full text index

Can someone give me an estimate time to populate a full-
text index, SQL Server 2000:
-14 million rows,
- each row is about 1 paragraph long. (approx 400 words and is stored in a LONG TEXT field)
- Language of the text: mixed.
- W.H.:a single CPU 2.8GHZ with 2GB Ram and have 300GB disk space
-incremental.
it has been running for 3 days now and who knows where we are...
Any way to speed up..
Thanks
mustafa,
Given your hardware configuration, and a table with 14 million rows will
take a substitational amount of time, approx 5 to 8 days.
Your best bet is to attempt to stop the Full or Incremental population and
consider horzatioanlly partitioning the table into several smaller tables,
perhaps broken up by date or PK range. If you plan to continue this, I'd
highly recommend that you consider upgrading all aspects of your hardware.
Specifically, consider a multiple CPU server with 2 or more GB of RAM with
your FT Catalogs on a separate disk controller and disk array configured as
RAID0 or RAID10. You should also set the resource_usage level of the
MSSearch service to 5 via sp_fulltext_service 'resource_usage', 5. However,
this will not help you now. I'd also recommend that you review the SQL
Server 2000 BOL title "Full-text Search Recommendations" and the following
FT Deployment white paper: INF: SQL Server 2000 Full-Text Search Deployment
White Paper at:
http://support.microsoft.com/default...b;en-us;323739
Regards,
John
"mustafa jarrar" <anonymous@.discussions.microsoft.com> wrote in message
news:6EC893FD-DD03-4FA1-BE01-052A19EB03AB@.microsoft.com...
> Can someone give me an estimate time to populate a full-
> text index, SQL Server 2000:
> -14 million rows,
> - each row is about 1 paragraph long. (approx 400 words and is stored in a
LONG TEXT field)
> - Language of the text: mixed.
> - W.H.:a single CPU 2.8GHZ with 2GB Ram and have 300GB disk space
> -incremental.
> it has been running for 3 days now and who knows where we are...
> Any way to speed up..
> Thanks
>

estimate table spaces

hi guys,
sp_spaceused 'table1'
I have two ntext columns in 'table1',
by default, is sp_spaceused calculating space for ntext too?Hi Britney
All columns are included. You can see this for yourself:
use pubs
go
select * into newtitles from titles
go
exec sp_spaceused newtitles, @.updateusage= true
go
alter table newtitles add info ntext
go
update newtitles set info = replicate(title, 100)
go
exec sp_spaceused newtitles, @.updateusage= true
go
HTH
Kalen Delaney
"Britney" <britneychen_2001@.yahoo.com> wrote in message
news:emryCsOpFHA.1044@.tk2msftngp13.phx.gbl...
> hi guys,
>
> sp_spaceused 'table1'
> I have two ntext columns in 'table1',
> by default, is sp_spaceused calculating space for ntext too?
>
>|||When NTEXT column is NULL, how come it still takes some spaces?
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:ODCxkYQpFHA.3828@.TK2MSFTNGP12.phx.gbl...
> Hi Britney
> All columns are included. You can see this for yourself:
> use pubs
> go
> select * into newtitles from titles
> go
> exec sp_spaceused newtitles, @.updateusage= true
> go
> alter table newtitles add info ntext
> go
> update newtitles set info = replicate(title, 100)
> go
> exec sp_spaceused newtitles, @.updateusage= true
> go
> HTH
> Kalen Delaney
>
> "Britney" <britneychen_2001@.yahoo.com> wrote in message
> news:emryCsOpFHA.1044@.tk2msftngp13.phx.gbl...
>
>|||Kevin
LOB data (type text, ntext and image) is by default stored on separate pages
outside the data rows. As soon as you update any rows with LOB data to
anything, even null, SQL Server will allocate at least 2 additional pages to
start keeping track of that data.
FYI, for ANY fixed length data column, NULLs will take space. So a char(100)
that contains NULL will take the full 100 bytes.
HTH
Kalen Delaney
www.solidqualitylearning.com
"kevin" <pearl_77@.hotmail.com> wrote in message
news:%23OP4VFYpFHA.3380@.TK2MSFTNGP12.phx.gbl...
> When NTEXT column is NULL, how come it still takes some spaces?
>
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:ODCxkYQpFHA.3828@.TK2MSFTNGP12.phx.gbl...
>
>

Estimate storage saving of varDecimal

For an existing database is there an automated method of calculating
the storage saving of using varDecimal storage type?
There is a whitepaper that was just released answering this very question:
http://msdn2.microsoft.com/en-us/library/bb508963.aspx
"Robin9876" <robin9876@.hotmail.com> wrote in message
news:1180623179.357966.223520@.h2g2000hsg.googlegro ups.com...
> For an existing database is there an automated method of calculating
> the storage saving of using varDecimal storage type?
>
|||I had already seen this but after reading it again I noticed that the
stored procedures mentioned could use the existing tables and not just
the best and worst cases as in the whitepaper.
On 31 May, 15:58, "Mike Walsh" <[mwalsh9815][at][gmail][dot][com]>
wrote:[vbcol=seagreen]
> There is a whitepaper that was just released answering this very question:
> http://msdn2.microsoft.com/en-us/library/bb508963.aspx
> "Robin9876" <robin9...@.hotmail.com> wrote in message
> news:1180623179.357966.223520@.h2g2000hsg.googlegro ups.com...

Estimate storage saving of varDecimal

For an existing database is there an automated method of calculating
the storage saving of using varDecimal storage type?There is a whitepaper that was just released answering this very question:
http://msdn2.microsoft.com/en-us/library/bb508963.aspx
"Robin9876" <robin9876@.hotmail.com> wrote in message
news:1180623179.357966.223520@.h2g2000hsg.googlegroups.com...
> For an existing database is there an automated method of calculating
> the storage saving of using varDecimal storage type?
>|||I had already seen this but after reading it again I noticed that the
stored procedures mentioned could use the existing tables and not just
the best and worst cases as in the whitepaper.
On 31 May, 15:58, "Mike Walsh" <[mwalsh9815][at][gmail][dot]
[com]>
wrote:[vbcol=seagreen]
> There is a whitepaper that was just released answering this very question:
> http://msdn2.microsoft.com/en-us/library/bb508963.aspx
> "Robin9876" <robin9...@.hotmail.com> wrote in message
> news:1180623179.357966.223520@.h2g2000hsg.googlegroups.com...
>

Estimate storage saving of varDecimal

For an existing database is there an automated method of calculating
the storage saving of using varDecimal storage type?There is a whitepaper that was just released answering this very question:
http://msdn2.microsoft.com/en-us/library/bb508963.aspx
"Robin9876" <robin9876@.hotmail.com> wrote in message
news:1180623179.357966.223520@.h2g2000hsg.googlegroups.com...
> For an existing database is there an automated method of calculating
> the storage saving of using varDecimal storage type?
>|||I had already seen this but after reading it again I noticed that the
stored procedures mentioned could use the existing tables and not just
the best and worst cases as in the whitepaper.
On 31 May, 15:58, "Mike Walsh" <[mwalsh9815][at][gmail][dot][com]>
wrote:
> There is a whitepaper that was just released answering this very question:
> http://msdn2.microsoft.com/en-us/library/bb508963.aspx
> "Robin9876" <robin9...@.hotmail.com> wrote in message
> news:1180623179.357966.223520@.h2g2000hsg.googlegroups.com...
> > For an existing database is there an automated method of calculating
> > the storage saving of using varDecimal storage type?sql

Estimate Snapshow Duration

Dear all,
I am going to set up a snapshot replicate. it will run nightly. The size of
DB is around 2GB, does anyone know how long will it take to completed the
snapshot replication. Is there any way of estimate the duration? Doesn't have
to be very accurate, a rough figure will do.
Thanks,
Jas
Jas,
this is almost impossible, as your network bandwidth at the time of the
replication and the indexes you have on the tables are just two factors
that'll change the result radically. Perhaps you can 'calibrate' the system
yourself in a rough way by replicating a table of 100MB with representative
indexes to a dummy database and then multiplying the result by 20 - just a
finger inthe air, but will give you some idea.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

estimate size of table based on number of rows

Hi everyone,
This might be a tough one, I don't know if this is doable.
Basically I want to create a stored procedure to return estimated size of a
table.
because I don't know how many rows it will have in the future, I want to
calcuate how much disk space it takes to have one row,
then multiply by number of rows I specified. (space calculation for index is
not necessary).
EXEC GetEstimateTableSize @.TableName='Table1', @.NumberOfRows ='3000000'
it'll return value in KBs after I execute proc. possible?If you run :
EXEC dbo.sp_spaceused table_name
You get the current space usage. Divide it by the current number of rows,
and multiply by the projected one.
If the table is completely empty or you'd rather calculate theoretical size,
there are formulas you can use from BOL, or better yet, a lengthy discussion
on internal structures and row sizes in Inside SQL Server 2000.
BG, SQL Server MVP
www.SolidQualityLearning.com
"Britney" <britneychen_2001@.yahoo.com> wrote in message
news:uWKIMMBpFHA.3936@.TK2MSFTNGP10.phx.gbl...
> Hi everyone,
> This might be a tough one, I don't know if this is doable.
> Basically I want to create a stored procedure to return estimated size of
> a table.
> because I don't know how many rows it will have in the future, I want to
> calcuate how much disk space it takes to have one row,
> then multiply by number of rows I specified. (space calculation for index
> is not necessary).
>
> EXEC GetEstimateTableSize @.TableName='Table1', @.NumberOfRows ='3000000'
>
> it'll return value in KBs after I execute proc. possible?
>
>
>
>
>
>|||Have you looked in the Books Online for sp_spaceused? It'll get you
part of the way there because it returns the rows used and the current
size of the table. Here's a quick and dirty stab at it; obviously
it'll need polishing:
This is actually a pretty useful idea; I'm planning on using this
myself.
Stu
DECLARE @.Table varchar(255)
DECLARE @.NumberOfRows int
SET @.Table = 'Splat'
SET @.NumberOfRows = 1
CREATE TABLE #t (name varchar(255),
rows int,
reserved varchar(100),
data varchar(100),
index_size varchar(100),
unused varchar(100))
--how big is the table now?
exec sp_spaceused @.Table
INSERT INTO #t
exec sp_spaceused @.Table
--strip off the ' KB' from the data column
--convert data and rows to decimal, and
--divide data by number of rows and multiply by number of anticipated
rows
SELECT rows, data, (data/rows) * @.NumberOfRows
FROM ( SELECT rows = CONVERT(decimal(32,3), rows),
data = CONVERT(decimal(32,3), LEFT(data, LEN(data)-3))
FROM #t) x
DROP TABLE #t
HTH,
Stu|||The following may help:
http://www.microsoft.com/downloads/...&displaylang=en
If you need it in a SP, try to understand the formulas used in the
spreadsheet and translate them in T-SQL (using the data from syscolumns
and other system tables).
Razvan|||I see 4 columns called reserved , index_size, unused, data
I guess I need to add 4 columns to get the total size, then divide by number
of row to find out how much disk space per row?
then disk space per row * estimate number of rows to find out estimate size?
"Itzik Ben-Gan" <itzik@.REMOVETHIS.SolidQualityLearning.com> wrote in message
news:etjHceBpFHA.2888@.TK2MSFTNGP10.phx.gbl...
> If you run :
> EXEC dbo.sp_spaceused table_name
> You get the current space usage. Divide it by the current number of rows,
> and multiply by the projected one.
> If the table is completely empty or you'd rather calculate theoretical
> size, there are formulas you can use from BOL, or better yet, a lengthy
> discussion on internal structures and row sizes in Inside SQL Server 2000.
> --
> BG, SQL Server MVP
> www.SolidQualityLearning.com
>
> "Britney" <britneychen_2001@.yahoo.com> wrote in message
> news:uWKIMMBpFHA.3936@.TK2MSFTNGP10.phx.gbl...
>|||You need the data + index_size.
Reserved includes: data + index_size + unused.
BG, SQL Server MVP
www.SolidQualityLearning.com
"Britney" wrote:

> I see 4 columns called reserved , index_size, unused, data
> I guess I need to add 4 columns to get the total size, then divide by numb
er
> of row to find out how much disk space per row?
> then disk space per row * estimate number of rows to find out estimate siz
e?
> "Itzik Ben-Gan" <itzik@.REMOVETHIS.SolidQualityLearning.com> wrote in messa
ge
> news:etjHceBpFHA.2888@.TK2MSFTNGP10.phx.gbl...
>
>|||but I have a NTEXT column,
I don't think it can calculate NTEXT.
"Razvan Socol" <rsocol@.gmail.com> wrote in message
news:1124386169.690259.289640@.z14g2000cwz.googlegroups.com...
> The following may help:
> http://www.microsoft.com/downloads/...&displaylang=en
> If you need it in a SP, try to understand the formulas used in the
> spreadsheet and translate them in T-SQL (using the data from syscolumns
> and other system tables).
> Razvan
>|||Indeed, ntext columns are not covered by the spreadsheed.
In the DataSizer.doc file, they wrote:
The tool does not include the formula to estimate the size of a table
that has Text columns. Not NULL text values consume 16 bytes in the
data row and have a minimum size of 84 bytes on the text page. Text
values are packed onto text pages with the same algorithm as data
rows so it should be possible to estimate the size of text data
storage using the HEAP table spreadsheet if you know the average size
of your text values.
Razvan|||if I use sp_spaceused 'tablename' command,
if that table has a few NText Columns,
I think it will calculate total spaces including disk spaces for NTEXT
column, correct?
"Razvan Socol" <rsocol@.gmail.com> wrote in message
news:1124483366.622335.202490@.g49g2000cwa.googlegroups.com...
> Indeed, ntext columns are not covered by the spreadsheed.
> In the DataSizer.doc file, they wrote:
> The tool does not include the formula to estimate the size of a table
> that has Text columns. Not NULL text values consume 16 bytes in the
> data row and have a minimum size of 84 bytes on the text page. Text
> values are packed onto text pages with the same algorithm as data
> rows so it should be possible to estimate the size of text data
> storage using the HEAP table spreadsheet if you know the average size
> of your text values.
> Razvan
>

Estimate Size Of A Temporary Table

Hello,
how can I estimate the size (KB) of a temptable?
Thank You
silasPlease, can you give me some hints how to solve this issue?|||http://msdn2.microsoft.com/en-us/library/aa933068(SQL.80).aspx|||Please, can you give me some hints how to solve this issue?

It's as big a you fill it up...what's the question?|||It's as big a you fill it up...what's the question?
You misunderstood me. My question was "how to get the size", not "what's the size".

There is sp_spaceused, but this function doesn't work with temptables. The thing is, the user can create as many temptables as he wants. But this uses up the memory. So I need a way, to estimate the size of each temptable and the remaining memory.|||Why is the size important?

Size depends on amount of data and the datatype of the data.|||Why is the size important?

See above...|||Last edited by silas at 10:23...
You cannae fool me laddie ;)

This link (http://doc.ddart.net/mssql/sql70/da-db_1.htm) will help you find your answer...

estimate on how long it might take to full-text index a table with 21,000 rows?

i need to full-text index a table so that i can easily search the text fields of that table.. the table has about 21,000 rows, and i was wondering how long it might take to full-text index it?
thanksBetween four seconds and three years, depending on hardware configuration, table contents, and server load.

On a (very slightly) more serious note, I don't know of any way to give you a meaningful estimate.

-PatP