Вопрос

I have an SQL database that is reported as being 40Mb in size when I look in cPanel. If I try and export the database using PHPMyAdmin, the export file is only 900Kb in size.

The strange thing is, if I import this file into a clean database then everything does appear to be there.

Anyone any ideas what could be causing this size issue? Maybe it is just being incorrectly reported?

Это было полезно?

Решение

The two answers prior to mine are pretty good, but I have a bit to add. Depending how cPanel is computing the space, there's a very simple explanation. Basically, certain table types don't reclaim disk space after your delete records. If, at one time, you stored 40Mb worth of data, then dropped a lot of it, that's a very reasonable cause for you to see it reported that the database still takes up 40Mb of space on disk.

Другие советы

That's because the database and the export are two completely different things.

The export contains only raw data and table structure, while the database itself also contains extra data that is used for indexes. Apart from that, the format in which the data is stored also doesn't have to be the same. An export is probably optimized for either size or recoverability (or both), while the data in the production database is optimized for speed.

It's hard to say, what is really causing this without having a look onto your schema. owever, in most cases there a indizies inside your database which are consuming place as well as some more meta data per row. Also depending on your engine, that data is stored in different ways and maybe reserving a lot of (at the moment) unneeded place for future, easier allocation. Another possibility could be, that you have exported the database compress -- there is an option for doing this in phpmyadmin.

So many reasons ;)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top