Support Forum

Broken DB tables and plugin tables optimization

LU Luca Urzi'
Luca Urzi'
Member

 Hi,

every week I have some kind of problems regarding the tables of the database and the website usually stops working because of that. Now it’s just unbearably slow, most of the time it takes a minute to load a page. Usually the website just goes down, saying there’s a problem reaching the db.

Last time the problem was with the table sfcache. 

I reckon the tables are getting bigger and bigger, so is there a way to optimize them? 

Thank you in advance,

http://realityhouse.it

21 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Actually, MySQL has proven to be remarkably resilient and handles large tables and databases remarkably well. It is extremely doubtful that you have any problem with the size of the DB unless you are starting to see tables with records in the hundreds of thousands – and even then it is manageable.

However – your database DOES require a little care and attention now and then – regardless of it’s size. To put it in plain language, it can get a little disordered and chaotic. We recommend that a full database optimisation is performed regularly – say once a week. This will keep it in good condition and working at full strength and performance.

There are quite a few WP plugins that will enable you to do this from within the WP Admin. At least one – titled I believe, WP DB Manager, will allow you to set a scheduled optimisation run so that it all takes place in the background.

LU Luca Urzi'
Luca Urzi'
Member

Thank you for your answer. Just to show you, this morning we are dealing with this kind or problem:

http://realityhouse.it

Topics don’t appear on the Homepage and you need to browse through them to find them, with a lot of missing informations (the latest discussions on the right, who posted and where, etc.). 

Plus, we keep receiving an error window from page to page (you can see it by browsing through them).

Any idea? 

YS Yellow Swordfish
Yellow Swordfish
Member

Luca Urzi’ said
Topics don’t appear on the Homepage and you need to browse through them to find them, with a lot of missing informations (the latest discussions on the right, who posted and where, etc.). 

I am going to need more information here. Like – where should this show up? Are you using the widget? Or the template tag? What are the settings?

Plus, we keep receiving an error window from page to page (you can see it by browsing through them).

Is this telling you that you have an invalid database query? I see it vaguely although it does not show up too well. If so then please go the forum admin > toolbox > error log and clear the current log (button at the bottom). Then switch pages on the site to generate the error. Then go back to the error log and copy the database error text and paste it to a post here for me to look at.

LU Luca Urzi'
Luca Urzi'
Member

Yellow Swordfish said

Luca Urzi’ said
Topics don’t appear on the Homepage and you need to browse through them to find them, with a lot of missing informations (the latest discussions on the right, who posted and where, etc.). 

I am going to need more information here. Like – where should this show up? Are you using the widget? Or the template tag? What are the settings?

Plus, we keep receiving an error window from page to page (you can see it by browsing through them).

Is this telling you that you have an invalid database query? I see it vaguely although it does not show up too well. If so then please go the forum admin > toolbox > error log and clear the current log (button at the bottom). Then switch pages on the site to generate the error. Then go back to the error log and copy the database error text and paste it to a post here for me to look at.  

3 maggio, 2017 12:17 | spaErrError | 1 | database

file: /var/www/html/wp-content/plugins/simple-press/sp-api/sp-api-class-user.php
line: 101
function: spdb_table
error: Table ‘avwp_sfmembers’ is marked as crashed and should be repaired

SELECT * FROM avwp_sfmembers WHERE user_id=102

3 maggio, 2017 12:17 | spaErrError | 1 | database


file: /var/www/html/wp-content/plugins/simple-press/sp-api/sp-api-class-user.php
line: 105
function: sp_create_member_data
error: Duplicate entry ‘102’ for key ‘PRIMARY’

INSERT INTO avwp_sfmembers (user_id, display_name, admin, moderator, avatar, signature, posts, lastvisit, checktime, newposts, admin_options, user_options, feedkey) VALUES (102, ‘Alex87’, 0, 0, ‘a:1:{s:8:”uploaded”;s:0:””;}’, ”, -1, ‘2017-05-03 12:17:57’, ‘2017-05-03 12:17:57’, ‘a:3:{s:6:”topics”;a:0:{}s:6:”forums”;a:0:{}s:4:”post”;a:0:{}}’, ”, ‘a:6:{s:10:”hidestatus”;i:0;s:8:”timezone”;d:2;s:15:”timezone_string”;s:11:”Europe/Rome”;s:6:”editor”;i:1;s:8:”namesync”;i:1;s:11:”unreadposts”;s:2:”50″;}’, ‘d952fe55-97cd-4746-957f-0127a5645f9d’)

and others :/ 

YS Yellow Swordfish
Yellow Swordfish
Member

It states it quite clearly in the error message for the DB:

error: Table ‘avwp_sfmembers’ is marked as crashed and should be repaired

See post #2 above. This needs to be done urgently. It is probably also responsible for missing information in the display. Note it now says it has crashed completely so it needs a repair AND an optimise after that.

After you have repaired and optimised the database, clear out the error log again and repeat the test.

LU Luca Urzi'
Luca Urzi'
Member

I did everything you suggested (fixed the tables and optimized them with a plugin) but I keep receiving an error message. 

You can see it on every page you browse.

http://realityhouse.it/

What can I do? 

MP Mr Papa
Mr Papa
Member

sorry, but I do not see any errors displayed on the page you provided (http://realityhouse.it)…  is it only happening for admins?  or have you corrected it?

and your latest images were not uploaded…

LU Luca Urzi'
Luca Urzi'
Member

Mr Papa said
sorry, but I do not see any errors displayed on the page you provided (http://realityhouse.it)…  is it only happening for admins?  or have you corrected it?

and your latest images were not uploaded…  

I updated the server and that was it.

As for the two images:

LU Luca Urzi'
Luca Urzi'
Member

Mr Papa said
so all fixed up now??  

the website keeps going slow, I’m afraid it’s still has to do with the tables. I’ll let you know if he goes down again.

As for the profile updating I still get the “null” message I mentioned sometime ago. 

When you try to edit something inside your profile (avatar, signature or password) you receive this null message. Any idea where I should go? 

MP Mr Papa
Mr Papa
Member

as to profile, please check when saving the data with the browser console open….

do you have a link to your site so we can look for obvious conflicts?

Those last two errors dont make any sense…. it says you are trying to create a member that already exists…  has this site been working before?  did you try importing an old sp db into another wp site??  not sure how wp can try to create a new user where one already exists…

how many rows in the wp users table?  how many rows in the sfmembers table?

LU Luca Urzi'
Luca Urzi'
Member

Mr Papa said
as to profile, please check when saving the data with the browser console open….

do you have a link to your site so we can look for obvious conflicts?

Those last two errors dont make any sense…. it says you are trying to create a member that already exists…  has this site been working before?  did you try importing an old sp db into another wp site??  not sure how wp can try to create a new user where one already exists…

how many rows in the wp users table?  how many rows in the sfmembers table?  

sorry for the late response 

There are 13473 rows in the wp users table and 13467 in the sfmembers table.

I imported an old sp db into a new wp site 2 or 3 years ago, never ever I had such problems before.
 
I also checked the browser console while updating the profiles and no errors are detected even when the “null” message comes up.
 
Today the old “invalid request to the database” pops up every time you open a page of a thread. We keep optimizing the database everyday, but after a few days the problems return (fi: in the “new users” statistic in the bottom part of the forum there are often old users with “_1” after the username, then the url links to the old user and not a new one).
 
I’m willing to give you an access to my website so you can access the backend and tell me what to do. 
 
http://realityhouse.it