473,771 Members | 2,347 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Record Size Calculation

Hi,

1. I want to calculate size of the record by mysql queries. Is it
possible..
2. What is the best way to calculate table record size which consists
of Text type.

Regards,
@wahab.

Feb 11 '06 #1
6 14410
<sa******@yahoo .com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
1. I want to calculate size of the record by mysql queries. Is it
possible..
See http://dev.mysql.com/doc/refman/5.0/...uirements.html
2. What is the best way to calculate table record size which consists
of Text type.


TEXT types, like other BLOB types and VARCHAR, use a variable amount of
storage per record, based on the content stored there. So it's hard to
predict the amount of storage accurately. You have to fetch each record and
see what's stored there.

Regards,
Bill K.
Feb 12 '06 #2
sa******@yahoo. com wrote:
Hi,

1. I want to calculate size of the record by mysql queries. Is it
possible..
2. What is the best way to calculate table record size which consists
of Text type.

Regards,
@wahab.


you may do it outside mysql, for example(under WinXP):

mysql -e "select field1, field2, field3 from mytable" mydb -p > a.txt

and then handle the file which contains tab separated records:

perl -lne " tr/\t//; $t += length }{ print$t" a.txt

this command trims tab and newlines, and then adds up the number of
characters in each line. $t finally prints the total number of
characters you have in your query result.

Best,
Xicheng

Feb 13 '06 #3

Bill Karwin wrote:
<sa******@yahoo .com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
1. I want to calculate size of the record by mysql queries. Is it
possible..


See http://dev.mysql.com/doc/refman/5.0/...uirements.html
2. What is the best way to calculate table record size which consists
of Text type.


TEXT types, like other BLOB types and VARCHAR, use a variable amount of
storage per record, based on the content stored there. So it's hard to
predict the amount of storage accurately. You have to fetch each record and
see what's stored there.

Regards,
Bill K.


Thx for ur reply Mr.Bill.

Actually my requirement is to limit the user storage like how email
clients doing. If i do caculation on everytime when the page display,
that would be slower the server performance. Instead, is it nice if
calculate the amount of storage then store in the same record in a
clolumn while insert or update, and while fetching just SUM the storage
column. Or is there any other way!!!

And let say.. if i have value 12 in INT type column, and I have value
12345 in other INT type column.. does both occupy 4 bytes each.

Regards,
@wahab.

Feb 13 '06 #4
On 12 Feb 2006 19:02:32 -0800, in mailing.databas e.mysql
sa******@yahoo. com
<11************ **********@z14g 2000cwz.googleg roups.com> wrote:
|
| Bill Karwin wrote:
| > <sa******@yahoo .com> wrote in message
| > news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
| > > 1. I want to calculate size of the record by mysql queries. Is it
| > > possible..
| >
| > See http://dev.mysql.com/doc/refman/5.0/...uirements.html
| >
| > > 2. What is the best way to calculate table record size which consists
| > > of Text type.
| >
| > TEXT types, like other BLOB types and VARCHAR, use a variable amount of
| > storage per record, based on the content stored there. So it's hard to
| > predict the amount of storage accurately. You have to fetch each record and
| > see what's stored there.
| >
| > Regards,
| > Bill K.
|
| Thx for ur reply Mr.Bill.
|
| Actually my requirement is to limit the user storage like how email
| clients doing. If i do caculation on everytime when the page display,
| that would be slower the server performance. Instead, is it nice if
| calculate the amount of storage then store in the same record in a
| clolumn while insert or update, and while fetching just SUM the storage
| column. Or is there any other way!!!
|
| And let say.. if i have value 12 in INT type column, and I have value
| 12345 in other INT type column.. does both occupy 4 bytes each.


Yes.
http://dev.mysql.com/doc/refman/5.0/...uirements.html
---------------------------------------------------------------
jn******@yourpa ntsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Feb 13 '06 #5
<sa******@yahoo .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
Actually my requirement is to limit the user storage like how email
clients doing.
MySQL has no support for quotas to limit storage per user.
And let say.. if i have value 12 in INT type column, and I have value
12345 in other INT type column.. does both occupy 4 bytes each.


That's correct. The storage required by a given numeric data type is not
affected by the value you store there. You can't get space back by storing
negative values! :-)

Regards,
Bill K.
Feb 13 '06 #6
sa******@yahoo. com wrote:
Hi,

1. I want to calculate size of the record by mysql queries. Is it
possible..
2. What is the best way to calculate table record size which consists
of Text type.

Regards,
@wahab.

look at:

http://dev.mysql.com/doc/refman/5.0/...les-table.html
*note* version 5.0+

select table_schema,ta ble_name,avg_ro w_length,max_ro w_length from
information_sch ema.tables;

--
Michael Austin.
DBA Consultant
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Feb 22 '06 #7

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

Similar topics

4
2864
by: Ace Alexander | last post by:
My current Mysql database has a table with a Text field and a few blob fields. The average record can range from 500kb to 5mg, the bulk coming from the blob fields. I select from each record based on words in the Text field, but after about 3000 records, the search takes too long. If I setup another table that has just the text field and shares a key with a table containing the blobs, will it be quicker to search the Text field? In...
2
1603
by: grayFalcon | last post by:
Hello! I've got a small problem here. I'm trying to write some code that would generate a drop-down menue for me, where I'd just need to enter the menu- and submenu items into an array. The items are to be displayed as text. Now, I want to have the layers with the submenues to appear more or less under the appropriate main menu items. For this I need to be able to calculate how many pixels a given text uses up on the screen of the user....
1
6622
by: DB_2 | last post by:
I was looking at DB2 SQL reference books by IBM and saw the maxium size limits on CHAR, VARCHAR and other data types. Is there a similar limit on the total number of bytes per row? In other words, what is the maximum number of bytes that a table can have per record? Thanks in advance!
1
3624
by: Danny | last post by:
I have one person who uses an access database for his billing info, and now he is way up there, maybe 20 thousand records.. 1. is there a limit to the size of an access database? 2. this is off topic. this is an access database being used in vb6, is there vb code I could use in vb6 app that will let them compact the database automatically? thanks in advance
1
2274
by: cdelaney | last post by:
I have a form that I created a calculation on using 2003. The calculation works exactly like I want it to but ONLY on the first and last record. The calculation does not work/exist on records in between .. I have checked many of the properties to see what got set unintentionally that might make only the first and last record show the values. Has anyone experienced this? I'm baffled.
3
2000
by: Mike Turco | last post by:
I'm working on an application that imports and exports tons of CSV data, like 64,000 records per file, and six or seven files in a set. First off, by the tine I import a few hundred thousand records the database is _huge_. Like 500 meg, although the csv files are only 25 meg in total. When I compact the database its still 100meg. How do I keep the size down? Second, I did a manual delete of 300,000 records yesterday by doing a...
3
11786
by: RamaKrishna Narla | last post by:
Hi, In MS SQL Server, while creating the table, I am getting a warning message saying like "maximum row size can exceed allowed maximum size of 8060 bytes". Is there any way in SQL Server, to increase this allowed maximum row size? The setting like "set ANSI_WARNINGS OFF" is not suitable in my case. I
10
2199
klarae99
by: klarae99 | last post by:
I am working on an Inventory Database in Access 2003. I am having trouble with a report I designed to show current inventory in stock. I have a form (frmInventory) that is unbound. There are four combo boxes on this form that allow the user to select Location, Vendor, Category and SubCategory. These selections (or blank fields) are then passed on to a query (see SQL below) and a report opens to show the inventory. This worked really well...
0
1086
by: wendi | last post by:
I have the strangest problem with an access query/report. The calculations in the query work perfectly …. I create my report and it has perfect calculations too; however when I attempt to add my report to my form and run it based on the forms record … the calculation numbers are all wrong. It has the correct records just incorrect calculations. When I run the query/report manually by entering the record number it also works perfectly. Does...
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10102
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.