Notifications
Clear all

Slow queries

10 Posts
2 Users
1 Likes
711 Views
Posts: 259
Customer
Topic starter
(@percysgrowroom)
Member
Joined: 5 years ago

I keep getting a slow query warning for this:

 

wpForoAttachments->get_sizes()

 

Any ideas on how to resolve it? 

9 Replies
Posts: 259
Customer
Topic starter
(@percysgrowroom)
Member
Joined: 5 years ago

Can anyone help with this? 

 

Reply
6 Replies
 Tom
Admin
(@tomson)
Joined: 9 years ago

Famed Member
Posts: 4172

@percysgrowroom,

Use your phpMyAdmin database manager and execute the SQL below. Make sure the wp_ table prefix is changed to your table prefix:

ALTER TABLE `wp_wpforo_attachments` ADD INDEX(`size`);
Reply
Customer
(@percysgrowroom)
Joined: 5 years ago

Member
Posts: 259

@tomson Ok thanks Tom, Ill try, but im not too sure what you mean lol 

I will look into it, I appreciate your help man thanks 

Reply
Customer
(@percysgrowroom)
Joined: 5 years ago

Member
Posts: 259

@tomson Hi tom, I still havent done this as im scared i might break something, could you explain what Io have to do in a little more detail when you have time so i feel more comfortable doing it 🙂 I hate messing with databases

Reply
 Tom
Admin
(@tomson)
Joined: 9 years ago

Famed Member
Posts: 4172

@percysgrowroom,

The SQL command will add an index to wp_wpforo_attachments table > size field and make it faster. Just open your database with phpMyAdmin database manager, make sure your database table prefix is wp_ (if not, just change it) and execute the SQL query in the [SQL] tab.

Reply
Customer
(@percysgrowroom)
Joined: 5 years ago

Member
Posts: 259

@tomson what are the chances of it breaking my site? lol

Reply
 Tom
Admin
(@tomson)
Joined: 9 years ago

Famed Member
Posts: 4172

0%,

In any case you can back up the wp_wpforo_attachments table 

Reply
Posts: 259
Customer
Topic starter
(@percysgrowroom)
Member
Joined: 5 years ago
Posted by: @tomson

Just open your database with phpMyAdmin

I did that and then nothing  makes sense lol 

Posted by: @tomson

make sure your database table prefix is wp_ (if not, just change it) and execute the SQL query in the [SQL] tab.

can you explain this in more detail for a noob please mate lol 

Reply
1 Reply
 Tom
Admin
(@tomson)
Joined: 9 years ago

Famed Member
Posts: 4172

@percysgrowroom,

It adds a table index for 'size' field. It makes the counting of total attachments size many times faster. This will help make the wpForoAttachments->get_sizes() function (reported in your first post) to work faster.

Reply
Share:
Scroll to top