Showing posts with label bytes. Show all posts
Showing posts with label bytes. Show all posts

Friday, March 23, 2012

how much bytes needed in sql server

Hi i want to know how much bytes will sql server take to store a
single alphabet like "a". i need to know similarly for all data types
(including images).here i am doing a application where i need to
predict the amount of space required in sql server to store the user
fed dynamic data.

Give me a handy solution.

Regards
visuvisu (k.visube@.gmail.com) writes:

Quote:

Originally Posted by

Hi i want to know how much bytes will sql server take to store a
single alphabet like "a".


If you use varchar, that's one byte. If you use nvarchar, it's two bytes.

Quote:

Originally Posted by

i need to know similarly for all data types
(including images).here i am doing a application where i need to
predict the amount of space required in sql server to store the user
fed dynamic data.


Look up the "Data types" in Books Online. With this as a starting point,
you should be able to find the storeage consumption fo every data type.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||To add on to Erland's response, see the Books Online for topics on
estimating table and index size. In addition to the storage requirements of
individual columns, you'll need to add additional overhead for row, page,
etc.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"visu" <k.visube@.gmail.comwrote in message
news:1181746030.311842.326400@.o11g2000prd.googlegr oups.com...

Quote:

Originally Posted by

Hi i want to know how much bytes will sql server take to store a
single alphabet like "a". i need to know similarly for all data types
(including images).here i am doing a application where i need to
predict the amount of space required in sql server to store the user
fed dynamic data.
>
Give me a handy solution.
>
Regards
visu
>

|||On Jun 14, 5:40 pm, "Dan Guzman" <guzma...@.nospam-
online.sbcglobal.netwrote:

Quote:

Originally Posted by

To add on to Erland's response, see the Books Online for topics on
estimating table and index size. In addition to the storage requirements of
individual columns, you'll need to add additional overhead for row, page,
etc.
>
--
Hope this helps.
>
Dan Guzman
SQL Server MVP
>
"visu" <k.vis...@.gmail.comwrote in message
>
news:1181746030.311842.326400@.o11g2000prd.googlegr oups.com...
>
>
>

Quote:

Originally Posted by

Hi i want to know how much bytes will sql server take to store a
single alphabet like "a". i need to know similarly for all data types
(including images).here i am doing a application where i need to
predict the amount of space required in sql server to store the user
fed dynamic data.


>

Quote:

Originally Posted by

Give me a handy solution.


>

Quote:

Originally Posted by

Regards
visu- Hide quoted text -


>
- Show quoted text -


thanks for all the replies...

I dont find any useful books in online..
Can u people suggest some useful URL regarding to my problem ?

Regards
visu|||visu wrote:

Quote:

Originally Posted by

I dont find any useful books in online..
Can u people suggest some useful URL regarding to my problem ?


They are referring to what is (perhaps confusingly) named "SQL Server 2005
Books Online", as noted at the end of Erland's message.
http://technet.microsoft.com/en-us/...r/bb428874.aspx
Andrew|||In addition to the web URL, the documentation is also available via local
help. One method to find the relevant topic is by entering "estimating
table size" in the index search.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"visu" <k.visube@.gmail.comwrote in message
news:1181912433.105526.223140@.x35g2000prf.googlegr oups.com...

Quote:

Originally Posted by

On Jun 14, 5:40 pm, "Dan Guzman" <guzma...@.nospam-
online.sbcglobal.netwrote:

Quote:

Originally Posted by

>To add on to Erland's response, see the Books Online for topics on
>estimating table and index size. In addition to the storage requirements
>of
>individual columns, you'll need to add additional overhead for row, page,
>etc.
>>
>--
>Hope this helps.
>>
>Dan Guzman
>SQL Server MVP
>>
>"visu" <k.vis...@.gmail.comwrote in message
>>
>news:1181746030.311842.326400@.o11g2000prd.googlegr oups.com...
>>
>>
>>

Quote:

Originally Posted by

Hi i want to know how much bytes will sql server take to store a
single alphabet like "a". i need to know similarly for all data types
(including images).here i am doing a application where i need to
predict the amount of space required in sql server to store the user
fed dynamic data.


>>

Quote:

Originally Posted by

Give me a handy solution.


>>

Quote:

Originally Posted by

Regards
visu- Hide quoted text -


>>
>- Show quoted text -


>
thanks for all the replies...
>
I dont find any useful books in online..
Can u people suggest some useful URL regarding to my problem ?
>
Regards
visu
>

Monday, March 19, 2012

How many do I calculate my size of the table schema?

sql server allows 1024 coloumns or 8060 bytes per table.

But how can ? calculate this? or see this?

You should know types of columns. Each type has size of data it occupies, see in Books Online (BOL)

Monday, March 12, 2012

How long to create a non-clustered index?

I need to know how long it will take to create a non-clustered index given:
I know how many columns the index will affect, the column width in bytes, how many rows, an average row size, the number of hard disks, their speed in RPM, and they are setup in RAID 5.

Thanksdepends on lots of stuff|||What else do you need to know?|||there are too many variables. it could be 2 seconds to x number of hours. Hardware. configuration. is the table a terabyte in size or a megabyte in size. Is the column an int or varchar etc...(numbers process faster), what is already happening on the machine. Are the moons of saturn in alignment. is there a MLB conspiracy to have the cubs win the series this year now that red sox won.

just do it. if you are worried about what is going to ahppen to the computer, do it when everyone goes home or schedule it as job to run at midnight.|||The non-clustered index is created on 10 columns - each 100 bytes wide. The table is 6 X 10^6 rows and average 2000 bytes per row - so 12 X 10^9 bytes total. I have 5 15,000 RPM disks in RAID 5.

Take everything else out of the picture. I just need a mathematical way to estimate a best case/worst case scenario.|||I just need a mathematical way to estimate a best case/worst case scenario.

No you don't.

It's a bad idea in the first place

Don't do it.|||Can you explain how you came to this humble conclusion?|||I am tiddy bit curious about why anyone would need a 10 column index but I decided to keep my mouth shut.|||if memory serves (and it often does'nt) multi column idexes only do any good if all of the columns are searched in the same query and are queried in the same order that they appear in the index.

Seems to me something like this would be a performance hit on inserts and deletes and updates and such.

Am I close Brett.|||Can you explain how you came to this humble conclusion?

Let's see, a thousand byte + wide index...

I would think that would be very ineffecient.

Also, if you needed anything else from the row, I imagine, the optimizer might choose to ignore it anyway.

humble, not humble, whatever, it has nothing to do with it.

It's a bad idea.

Post the DDL of this table.

And who told you that you need that index?|||Seems to me something like this would be a performance hit on inserts and deletes and updates and such.

:eek:

Ya think?

Am I close to Brett.

Let's not start picking out wallpaper or anything... :)

But if you're buying...I'll have a 'rita on the rocks... :D