Support » Fixing WordPress » Why db size increased

  • I was cleaning unnecessary rows from wp_options table. And I have so much unnecessary rows due to malicious code that I am cleaning them by 500 row each time. I deleted may be 5000 rows but then when i saved a backup the new version file size was considerably more than the previous one ,even if the previous one had more rows.
    How can this be? I am not talking about small difference. The file sql file size of database suddenly went up from 120 MB to around 160 MB !!
    Even though I was deleting many many rows from the database. And between two files may be only 15 minutes exist. And I did nothing else. Why did this happen?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    Thread Starter ketanco

    (@ketanco)

    so here do the deleted rows go? still stay in database?
    I cannot follow this now. I dont want to do soething wrong
    Where do the deleted rows go? If I know I can physically remove
    I thought when we deleted rowss from database it is physically removing
    And it still doesnt explain the file size increase
    So this generic info dont work for me

    • This reply was modified 10 months, 1 week ago by ketanco.

    Theres two way for deleting database rows, empty and drop, if you use empty it will made empty space, and if you use drop it will be exit completely from database table.

    Try to optimize your database with a plugin, it may be helpful if it occurred by spaces.

    Thread Starter ketanco

    (@ketanco)

    I open the table, I select the rows I ant to delete and hit delete and it lists all rows I selected such as:

    DELETE FROM wp_options WHERE wp_options.option_id = 118444;

    And I hit yes….
    So this doesnt physically remove these rows? if not where do these rows go?

    I dont see “drop” anywhere for this. (I saw drop for entire table but I will not delete entire table)

    You do right, can you try an optimization plugin? As this:
    https://wordpress.org/plugins/vevida-optimizer/

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    You do not need a plugin as PHMYADMIN will handle this.

    When you delete a row with a DELETE statement in mysql, it just marks the row as deleted.

    This is *not* a WordPress thing; it’s how MySQL works.

    Thread Starter ketanco

    (@ketanco)

    Yes of course, so that physically deletes these right? I just couldnt understand why the db size increased suddenly. Now I started checking the total number of rows in the database, as in phpmyadmin it writes the sum. At least that also decreases, so i am sure that not only the wp options table I am deleting decreases, but the total rows also decrease. So no new rows is opening somewhere mysterical and things get physically deleted. I just couldnt understand why file size had increased. Even when I opened them in notepad and compared number of characters, the number of characters had also increased, although the rows are decreasing. weird

    Thank you @sterndata but problem is as them said, growing size after deleting rows!
    @ketanco please check the plug-in, after install go to tools>>optimise mysql tables, for me it save more than 50% in wp options table. Give it a try and say me the results 🙂

    Thread Starter ketanco

    (@ketanco)

    I tried a plugin wp optimize 3.1.2 as it had highest installation and ratings
    it reduced overhead columns, and the size of file by about 10MB
    I am now barely at the point of yesterday. Still cannot figure how the db size went up yesterday anyway but so it is goign down now

    • This reply was modified 10 months, 1 week ago by ketanco.
    • This reply was modified 10 months, 1 week ago by ketanco.
    • This reply was modified 10 months, 1 week ago by ketanco.

    I dont understand really, in innodb its sometime bug grow space even by deleting raws.
    May it is by saved id’s or somethings about that, it is not important, always use OPTIMISE in mysql time to time(weekly, monthly or even yearly), the plugin i said help you by run OPTIMISE in all wordpress mysql tables.

    REMEMBER however it is NOT a problem about wordpress, and it is not a true thing you use your time for that! Take it easy.

    P.S: the plugin i said simple run a MySQL OPTIMISE COMMAND nothing else. But yes the plugin you installed do cleaning and some more features.

    • This reply was modified 10 months, 1 week ago by Farhad. Reason: P.S
    Thread Starter ketanco

    (@ketanco)

    you are correct
    thank you guys !

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Why db size increased’ is closed to new replies.