PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > Table Size
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Table Size

Réponse
 
LinkBack Outils de la discussion
Vieux 27/10/2007, 15h09   #1
Josh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Table Size

Hello,

I have a database that is growing at a rate of 4-5 MB per day (that number is getting larger as well). Not too bad but I'm trying to clean up the tables to minimize the amount of space they take up.

I have one particular table that has 2 columns:
rolID int(10) unsigned
repID int(10) unsigned

Both are foreign keys to other tables.

A "show table status" shows that this table has a Data_length=1081344 bytes.
http://dev.mysql.com/doc/refman/5.0/...uirements.html shows that integers take up 4 bytes of space.
There are currently 10472 rows in the table.

10472 x 4 x 2 = 83776

What am I calculating wrong? Why isthe Data_length value so much larger?

Thanks.
  Réponse avec citation
Vieux 27/10/2007, 15h17   #2
Baron Schwartz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Table Size

Josh wrote:
> Hello,
>
> I have a database that is growing at a rate of 4-5 MB per day (that number is getting larger as well). Not too bad but I'm trying to clean up the tables to minimize the amount of space they take up.
>
> I have one particular table that has 2 columns:
> rolID int(10) unsigned
> repID int(10) unsigned
>
> Both are foreign keys to other tables.
>
> A "show table status" shows that this table has a Data_length=1081344 bytes.
> http://dev.mysql.com/doc/refman/5.0/...uirements.html shows that integers take up 4 bytes of space.
> There are currently 10472 rows in the table.
>
> 10472 x 4 x 2 = 83776
>
> What am I calculating wrong? Why is the Data_length value so much larger?


It depends on the storage engine, indexes, and possibly other things.
What's the output of SHOW CREATE TABLE for this table? If you can't
tell us that, what's the storage engine?

(yes, I know Index_length is separate, but humor me).

Baron
  Réponse avec citation
Vieux 27/10/2007, 15h25   #3
js
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Table Size

Have you tried optimize table?

On 10/27/07, Josh <josh2780@yahoo.com> wrote:
> Hello,
>
> I have a database that is growing at a rate of 4-5 MB per day (that number is getting larger as well). Not too bad but I'm trying to clean up the tables to minimize the amount of space they take up.
>
> I have one particular table that has 2 columns:
> rolID int(10) unsigned
> repID int(10) unsigned
>
> Both are foreign keys to other tables.
>
> A "show table status" shows that this table has a Data_length=1081344 bytes.
> http://dev.mysql.com/doc/refman/5.0/...uirements.html shows that integers take up 4 bytes of space.
> There are currently 10472 rows in the table.
>
> 10472 x 4 x 2 = 83776
>
> What am I calculating wrong? Why is the Data_length value so much larger?
>
> Thanks.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h43.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09032 seconds with 11 queries