473,769 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

blob size

Hi,

I have a question about the size of a blob if it indeed needs to be set
and cannot be variable. I ask this question because I am trying to save
web pages to a database but a web page can be anywhere from 10
characters to 200,000 characters and using blob(200000) is very
inefficient.
I was thinking of using various size tables ready for various size
pages but I would be easier to manage having them all in one table.

Anyone have any input?

Thanks

Carl

Nov 27 '06 #1
4 68846
<ca**********@g mail.comwrote in message
news:11******** **************@ j44g2000cwa.goo glegroups.com.. .
Hi,

I have a question about the size of a blob if it indeed needs to be set
and cannot be variable. I ask this question because I am trying to save
web pages to a database but a web page can be anywhere from 10
characters to 200,000 characters and using blob(200000) is very
inefficient.
I was thinking of using various size tables ready for various size
pages but I would be easier to manage having them all in one table.

Anyone have any input?

Thanks

Carl
Carl,
I think you're confused. BLOBs are not 'zero filled' and only take up
the space you put in them plus a couple bytes, like this:

L = length of data, # = overhead

BLOB = L + 2 bytes (max size is 2^16 - 1 or 65,535 bytes, 65KB)
MEDIUMBLOB = L + 3 bytes (max size is 2^24 - 1 or 16,777,215 bytes, 16MB)
LONGBLOB = L + 4 bytes (max size is 2^32 - 1 or 4,294,967,295 bytes, 4GB)

....you obviously need to use a MEDIUMBLOB and no, a 1KB web page will not
consume 16MB of storage space in the database. Using different tables for
different sized documents would be a nightmare at best anyway.

Norm
--
FREE Avatar hosting at www.easyavatar.com

Nov 29 '06 #2
Thanks for the reply Norm,

I think I understood what you are explaining but just to confirm that I
have if I use the following sql statement;

create table page(page mediumblob(1677 7215));

should work for what I am doing. This way the inserted pages won't be
truncated and minimum disk space will be used.

Thanks again,
Carl
Norman Peelman wrote:
<ca**********@g mail.comwrote in message
news:11******** **************@ j44g2000cwa.goo glegroups.com.. .
Hi,

I have a question about the size of a blob if it indeed needs to be set
and cannot be variable. I ask this question because I am trying to save
web pages to a database but a web page can be anywhere from 10
characters to 200,000 characters and using blob(200000) is very
inefficient.
I was thinking of using various size tables ready for various size
pages but I would be easier to manage having them all in one table.

Anyone have any input?

Thanks

Carl

Carl,
I think you're confused. BLOBs are not 'zero filled' and only take up
the space you put in them plus a couple bytes, like this:

L = length of data, # = overhead

BLOB = L + 2 bytes (max size is 2^16 - 1 or 65,535 bytes, 65KB)
MEDIUMBLOB = L + 3 bytes (max size is 2^24 - 1 or 16,777,215 bytes, 16MB)
LONGBLOB = L + 4 bytes (max size is 2^32 - 1 or 4,294,967,295 bytes, 4GB)

...you obviously need to use a MEDIUMBLOB and no, a 1KB web page will not
consume 16MB of storage space in the database. Using different tables for
different sized documents would be a nightmare at best anyway.

Norm
--
FREE Avatar hosting at www.easyavatar.com
Nov 30 '06 #3
Norman Peelman wrote:
<ca**********@g mail.comwrote in message
news:11******** **************@ j44g2000cwa.goo glegroups.com.. .
Hi,
>
I have a question about the size of a blob if it indeed needs to be
set
and cannot be variable. I ask this question because I am trying to
save
web pages to a database but a web page can be anywhere from 10
characters to 200,000 characters and using blob(200000) is very
inefficient.
I was thinking of using various size tables ready for various size
pages but I would be easier to manage having them all in one table.
>
Anyone have any input?
>
Thanks
>
Carl
>
Carl,
I think you're confused. BLOBs are not 'zero filled' and only take
up
the space you put in them plus a couple bytes, like this:

L = length of data, # = overhead

BLOB = L + 2 bytes (max size is 2^16 - 1 or 65,535 bytes, 65KB)
MEDIUMBLOB = L + 3 bytes (max size is 2^24 - 1 or 16,777,215 bytes,
16MB)
LONGBLOB = L + 4 bytes (max size is 2^32 - 1 or 4,294,967,295 bytes,
4GB)

...you obviously need to use a MEDIUMBLOB and no, a 1KB web page will
not
consume 16MB of storage space in the database. Using different tables
for
different sized documents would be a nightmare at best anyway.
>>
<ca**********@g mail.comwrote in message
news:11******** ************@80 g2000cwy.google groups.com...
Thanks for the reply Norm,

I think I understood what you are explaining but just to confirm that I
have if I use the following sql statement;

create table page(page mediumblob(1677 7215));

should work for what I am doing. This way the inserted pages won't be
truncated and minimum disk space will be used.

Thanks again,
Carl

You don't specify the size at all (in fact, you can't, at least in MySQL4.1)
so:

create table page (page MEDIUMBLOB)

.... is what your after.

Norm
Nov 30 '06 #4
Thanks again Norm!

Norman Peelman wrote:
Norman Peelman wrote:
<ca**********@g mail.comwrote in message
news:11******** **************@ j44g2000cwa.goo glegroups.com.. .
Hi,

I have a question about the size of a blob if it indeed needs to be
set
and cannot be variable. I ask this question because I am trying to
save
web pages to a database but a web page can be anywhere from 10
characters to 200,000 characters and using blob(200000) is very
inefficient.
I was thinking of using various size tables ready for various size
pages but I would be easier to manage having them all in one table.

Anyone have any input?

Thanks

Carl

>
Carl,
I think you're confused. BLOBs are not 'zero filled' and only take
up
the space you put in them plus a couple bytes, like this:
>
L = length of data, # = overhead
>
BLOB = L + 2 bytes (max size is 2^16 - 1 or 65,535 bytes, 65KB)
MEDIUMBLOB = L + 3 bytes (max size is 2^24 - 1 or 16,777,215 bytes,
16MB)
LONGBLOB = L + 4 bytes (max size is 2^32 - 1 or 4,294,967,295 bytes,
4GB)
>
...you obviously need to use a MEDIUMBLOB and no, a 1KB web page will
not
consume 16MB of storage space in the database. Using different tables
for
different sized documents would be a nightmare at best anyway.
>
>
<ca**********@g mail.comwrote in message
news:11******** ************@80 g2000cwy.google groups.com...
Thanks for the reply Norm,

I think I understood what you are explaining but just to confirm that I
have if I use the following sql statement;

create table page(page mediumblob(1677 7215));

should work for what I am doing. This way the inserted pages won't be
truncated and minimum disk space will be used.

Thanks again,
Carl


You don't specify the size at all (in fact, you can't, at least in MySQL4.1)
so:

create table page (page MEDIUMBLOB)

... is what your after.

Norm
Nov 30 '06 #5

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

Similar topics

6
2238
by: Pierre-Benoit | last post by:
Hi there, I've a strange problem with ado.net and an Access db. I need to create a little C# app that take the content of "ole object" field and then save it into a file. The problem is that when I do the following Byte byteBLOBData = new Byte; byteBLOBData = (Byte)(ds.Tables.Rows);
3
4726
by: hamvil79 | last post by:
I'm implementig a java web application using MySQL as database. The main function of the application is basically to redistribuite documents. Those documents (PDF, DOC with an average size around 2Mb) are stored in BLOB column. The amount of documents for the first year should not exceed 5/6 Giga, but I cannot make prevision for the next years. Those documents are mainly just accessed (update and delete are not so
2
10263
by: Stanley Sinclair | last post by:
About to create a table which will "include" a BLOB. Am not sure how large to make the container and the tablespace. What I see says that BLOB is stored "separately." However, I don't know where. With a table kinda like: CREATE TABLE BLOB_TABLE ( BLOB_ID INT,
0
3141
by: Paul Kennedy | last post by:
I have a situation where I am utilizing code from MSDN to insert XLS files into a Microsoft Access Table in a column of Ole Object using VBA and DAO. That code also provides me with a method to extract the XLS files later. This works wonderfully. The Article is 103257, ACC: Reading, Storing, & Writing Binary Large Objects (BLOBs) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm/oledbaccessing_blob_data.asp I...
1
8713
by: Markusek Peter | last post by:
Hi, I'm using MySQLDriverCS. I've got no problem to store BLOB into database, but I can't get it back(save to file). Problem is with DataTable(returns string:( ) My code: -- DataTable dt = new MySQLSelectCommand(...; //select that row and column where is BLOB string dest = Server.MapPath("image.jpg"); FileStream binFile = new
2
9001
by: pmz | last post by:
Dear Group, I'm connecting in C# with remote (BSD) MySQL server with ODBC Driver, and I'm trying to find the best sollution in such problem: As I've read on MySQL manual, they have suggested table design including the BLOB-Fieldtype size in UInt64, where they've stored, while inserting, the size of inserted BLOB data. But in the matter of fact, I'm interested if it's necessary to include in table this integer field? Is there any way...
2
2059
by: pike | last post by:
DB2 UDB v8.2 (FP11) on AIX 5.2. I'm not an SQL guru, so please be gentle with me. I have a table that contains a BLOB(312MB) column, and I'd like to determine, in an efficient way, the row-counts to BLOB size ratio. The output would be something like this: BLOB Size (MB) Rowcount 0-32 2540
3
2001
by: deepaa | last post by:
Hi Friends, Actually i want to insert some pdf files in the mysql database....in the database i made as an blob content ... how much the blob size... it accepts if the pdf file is having 43kb....it's urgent please help me..i want to insert much size pdfs' so for that what can i do? Regards Shakthi
4
4262
by: skunapareddy | last post by:
I am needing to read a blob from database and pass it to another java program. I researched internet and found a program that reads a file on the client pc and gives bytes, but when I modified the code to read a blob from DB I am not having any luck, I am running this java programs using JDEVELOPER. Can anyone please give me some help? The code is as follows: ... private static byte getBytesFromBlob(Blob blob) throws Exception { ...
0
9420
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10205
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9851
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...
1
7401
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
6662
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
5293
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3949
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 we have to send another system
2
3556
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.