0

In the WordPress MySQL/MariaDB database there is a table with some columns that in my own uses of WordPress are never used.

The exact columns I am talking about are:

comment_status varchar(20)
ping_status varchar(20)
to_ping text
pinged text
comment_count bigint(20)

None of them is part of an index.

I wonder if removing those columns would make a notable performance difference.

Of course I cannot just remove those columns without modifying the WordPress core. My real goal behind the question is to gain feedback to know if it's worth the effort to participate in the WordPress development and find an alternative way to manage that information for websites still using those columns.

0

1 Answer 1

2

Unused columns do carry a cost, but rarely one that most people will notice or care about in systems with well-written, targeted queries. If you are curious about testing performance and contributing in a meaningful way to the WordPress project, you might want to consider doing something like this:

  1. Make a workable backup of your WordPress database. For example:

    sudo mysqldump wordpress > wordpress.sql
    

    Note: This assumes you would create backups via a command-line. If you prefer GUIs, make a backup in your preferred way.

  2. Drop the columns that you think you can live without:

    ALTER TABLE wp_posts DROP COLUMN comment_status;
    ALTER TABLE wp_posts DROP COLUMN ping_status;
    ALTER TABLE wp_posts DROP COLUMN to_ping;
    ALTER TABLE wp_posts DROP COLUMN pinged;
    ALTER TABLE wp_posts DROP COLUMN comment_count;
    
  3. See what breaks over the next few days. If WordPress is unhappy about something, it is not shy about telling the world that something is wrong.

    Then, if nothing bad happens...

  4. Begin modifying the WordPress API to handle those fields differently (if at all) and tweak the database to be more performant.

Working on a large project like WordPress can bring a great deal of satisfaction, particularly if any of your modifications are adopted by the core project.

1
  • Thanks for your useful, positive and friendly feedback. The thing with WP is it evolved naturally (without a long term plan), and this makes its codebase quite complex. For potential further readers, here is a link to the WP Core Trac Ticket where I will be posting my best intentions: core.trac.wordpress.org/ticket/53217 May 17, 2021 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.