Showing posts with label predict. Show all posts
Showing posts with label predict. Show all posts

Thursday, February 16, 2012

Calculating table size

I have a BIG database with 8 tables growing rapidly. I would like to estimate the size of a row in disk space so I can predict how big my bd will grow in time. I know the math to calculate this but I'm look for a tool to automate this task. A tool that takes into accout calculating index size aside from table size.

I would really apreciate any help on this.

regards

? Since you already have the tables, with rows of real data, I think you can do better than an estimation tool. Take the current table size: EXEC sp_spaceused 'yourTable' ... then get the number of rows: SELECT COUNT(*) FROM yourTable ... and divide. This will give you a much more realistic estimate than any tool can. -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Jorge González@.discussions.microsoft.com> wrote in message news:acc81bad-c554-4d2b-8289-fb1482786568@.discussions.microsoft.com... I have a BIG database with 8 tables growing rapidly. I would like to estimate the size of a row in disk space so I can predict how big my bd will grow in time. I know the math to calculate this but I'm look for a tool to automate this task. A tool that takes into accout calculating index size aside from table size. I would really apreciate any help on this. regards|||

The Disk Usage report in SQL Server Management Studio shows you the current size of your database breaking down the statistics by table, row size, index, partitions, etc.

I'm putting together a blog series on Management Studio reports. In the first post, I put together a 2 minute demo of how to view the reports and export them to Microsoft Excel 2007.

http://blogs.msdn.com/sqlrem/archive/2006/05/16/SSMS_Reports_1.aspx

-Paul

|||? Hi Paul, I'll check out your webcast, but I'd just like to give a bit of feedback on the reports themselves. Although I really love the look and feel and depth of content of these reports, I find that they're too heavy to run on a busy production server -- especially one with a lot of databases and/or a lot of tables. Would it be possible to modify the reports for a future release such that the drill-down data is "lazy loaded" on demand? This would make the reports a lot more useable for enterprise scenarios. -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Paul Mestemaker - MSFT@.discussions.microsoft..com> wrote in message news:7fb4862e-7192-496e-b484-e1547a88728d@.discussions.microsoft.com... The Disk Usage report in SQL Server Management Studio shows you the current size of your database breaking down the statistics by table, row size, index, partitions, etc. I'm putting together a blog series on Management Studio reports. In the first post, I put together a 2 minute demo of how to view the reports and export them to Microsoft Excel 2007. http://blogs.msdn.com/sqlrem/archive/2006/05/16/SSMS_Reports_1.aspx -Paul|||

I apologize for the delay in response, I have not setup the alerts properly.

We are somewhat limited in how we can load data into the ReportViewer control in Management Studio. There are two ways the control supports an interactive experience.

Drill-in
This is what we do today. We load in all of the data we need to render the report and show/hide information giving a simulated interactive experience.
|||

Hi Jorge,

You can try the following script on SQL 2000 / 2005

CREATE TABLE #SpaceUsed (name sysname,rows bigint,reserved sysname,data sysname,index_size sysname,unused sysname)

DECLARE @.Counter int
DECLARE @.Max int
DECLARE @.Table sysname

SELECT name, IDENTITY(int,1,1) ROWID
INTO #TableCollection
FROM sysobjects
WHERE xtype = 'U'
ORDER BY lower(name)

SET @.Counter = 1
SET @.Max = (SELECT Max(ROWID) FROM #TableCollection)

WHILE (@.Counter <= @.Max)
BEGIN
SET @.Table = (SELECT name FROM #TableCollection WHERE ROWID = @.Counter)
INSERT INTO #SpaceUsed
EXECUTE sp_spaceused @.Table
SET @.Counter = @.Counter + 1
END

SELECT * FROM #SpaceUsed

DROP TABLE #TableCollection
DROP TABLE #SpaceUsed

Regards

Calculating table size

I have a BIG database with 8 tables growing rapidly. I would like to estimate the size of a row in disk space so I can predict how big my bd will grow in time. I know the math to calculate this but I'm look for a tool to automate this task. A tool that takes into accout calculating index size aside from table size.

I would really apreciate any help on this.

regards

? Since you already have the tables, with rows of real data, I think you can do better than an estimation tool. Take the current table size: EXEC sp_spaceused 'yourTable' ... then get the number of rows: SELECT COUNT(*) FROM yourTable ... and divide. This will give you a much more realistic estimate than any tool can. -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Jorge González@.discussions.microsoft.com> wrote in message news:acc81bad-c554-4d2b-8289-fb1482786568@.discussions.microsoft.com... I have a BIG database with 8 tables growing rapidly. I would like to estimate the size of a row in disk space so I can predict how big my bd will grow in time. I know the math to calculate this but I'm look for a tool to automate this task. A tool that takes into accout calculating index size aside from table size. I would really apreciate any help on this. regards|||

The Disk Usage report in SQL Server Management Studio shows you the current size of your database breaking down the statistics by table, row size, index, partitions, etc.

I'm putting together a blog series on Management Studio reports. In the first post, I put together a 2 minute demo of how to view the reports and export them to Microsoft Excel 2007.

http://blogs.msdn.com/sqlrem/archive/2006/05/16/SSMS_Reports_1.aspx

-Paul

|||? Hi Paul, I'll check out your webcast, but I'd just like to give a bit of feedback on the reports themselves. Although I really love the look and feel and depth of content of these reports, I find that they're too heavy to run on a busy production server -- especially one with a lot of databases and/or a lot of tables. Would it be possible to modify the reports for a future release such that the drill-down data is "lazy loaded" on demand? This would make the reports a lot more useable for enterprise scenarios. -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Paul Mestemaker - MSFT@.discussions.microsoft..com> wrote in message news:7fb4862e-7192-496e-b484-e1547a88728d@.discussions.microsoft.com... The Disk Usage report in SQL Server Management Studio shows you the current size of your database breaking down the statistics by table, row size, index, partitions, etc. I'm putting together a blog series on Management Studio reports. In the first post, I put together a 2 minute demo of how to view the reports and export them to Microsoft Excel 2007. http://blogs.msdn.com/sqlrem/archive/2006/05/16/SSMS_Reports_1.aspx -Paul|||

I apologize for the delay in response, I have not setup the alerts properly.

We are somewhat limited in how we can load data into the ReportViewer control in Management Studio. There are two ways the control supports an interactive experience.

Drill-in
This is what we do today. We load in all of the data we need to render the report and show/hide information giving a simulated interactive experience.
|||

Hi Jorge,

You can try the following script on SQL 2000 / 2005

CREATE TABLE #SpaceUsed (name sysname,rows bigint,reserved sysname,data sysname,index_size sysname,unused sysname)

DECLARE @.Counter int
DECLARE @.Max int
DECLARE @.Table sysname

SELECT name, IDENTITY(int,1,1) ROWID
INTO #TableCollection
FROM sysobjects
WHERE xtype = 'U'
ORDER BY lower(name)

SET @.Counter = 1
SET @.Max = (SELECT Max(ROWID) FROM #TableCollection)

WHILE (@.Counter <= @.Max)
BEGIN
SET @.Table = (SELECT name FROM #TableCollection WHERE ROWID = @.Counter)
INSERT INTO #SpaceUsed
EXECUTE sp_spaceused @.Table
SET @.Counter = @.Counter + 1
END

SELECT * FROM #SpaceUsed

DROP TABLE #TableCollection
DROP TABLE #SpaceUsed

Regards

Tuesday, February 14, 2012

Calculating R-Squared from Decision Trees

Hello.

I am trying to build a decision tree to predict prices. I have created the tree and looked at the lift charts, but I have not seen any of the traditional statistics I am used to from other programs (R-Squared, F statistics, etc.).

Does anyone have an example of how they calculated R-Squared for a decision tree on a continuous variable?

Thanks,
Brian

Hello

This example (http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/4264.aspx) contains a stored procedure that returns the covariance and correlation matrix for a mining model. Hope this helps

|||This is helpful.

But are there stored procedures that calculate R-Squared, or MSE, or the F-Test for regression trees?

Or are there stored procedures others use to evaluate the performance on data mining models for continuous variables like profits or prices?

Thanks.|||

No, there are no system stored procedures to compute these accuracy measures. The stored procedure I indicated previously shows the main steps for such a test, in case you decide to write your own: drillthrough to fetch the training cases (for the whole model or for a single node) then compute the accuracy scores.

We consider adding more advanced accuracy measures for future versions

thanks

|||

We have another tip that shows how to calculates Lack of Fit for Microsoft Decision Trees and some other models:

http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/2271.aspx

We have a tip on how to calculate R square ready and will be published later.

Thanks,

|||

This tip is now available (it includes source code for a stored proc and sample app):

Calculating R-Squared for Microsoft regression models

|||Thanks for the stored procedure. It looks to be exactly what I am looking for.

I am not a Visual Studio Developer. Is there more basic/detailed instructions on how to build and deploy stored procedures in Visual Studio 2005.

When I try to open the project using Visual Studio 2005 I receive the following error:

"The Application for project Rsquarehelper.csproj is not installed"

Thanks. And I love the Excel 2007 DM Add Ins.

Calculating R-Squared from Decision Trees

Hello.

I am trying to build a decision tree to predict prices. I have created the tree and looked at the lift charts, but I have not seen any of the traditional statistics I am used to from other programs (R-Squared, F statistics, etc.).

Does anyone have an example of how they calculated R-Squared for a decision tree on a continuous variable?

Thanks,
Brian

Hello

This example (http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/4264.aspx) contains a stored procedure that returns the covariance and correlation matrix for a mining model. Hope this helps

|||This is helpful.

But are there stored procedures that calculate R-Squared, or MSE, or the F-Test for regression trees?

Or are there stored procedures others use to evaluate the performance on data mining models for continuous variables like profits or prices?

Thanks.
|||

No, there are no system stored procedures to compute these accuracy measures. The stored procedure I indicated previously shows the main steps for such a test, in case you decide to write your own: drillthrough to fetch the training cases (for the whole model or for a single node) then compute the accuracy scores.

We consider adding more advanced accuracy measures for future versions

thanks

|||

We have another tip that shows how to calculates Lack of Fit for Microsoft Decision Trees and some other models:

http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/2271.aspx

We have a tip on how to calculate R square ready and will be published later.

Thanks,

|||

This tip is now available (it includes source code for a stored proc and sample app):

Calculating R-Squared for Microsoft regression models

|||Thanks for the stored procedure. It looks to be exactly what I am looking for.

I am not a Visual Studio Developer. Is there more basic/detailed instructions on how to build and deploy stored procedures in Visual Studio 2005.

When I try to open the project using Visual Studio 2005 I receive the following error:

"The Application for project Rsquarehelper.csproj is not installed"

Thanks. And I love the Excel 2007 DM Add Ins.