Notifications
Clear all

Limited Support

Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed. We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.

 

Slow queries

10 Posts
2 Users
1 Reactions
1,261 Views
I Give Up
Posts: 296
Customer
Topic starter
(@percysgrowroom)
Member
Joined: 7 years ago

I keep getting a slow query warning for this:

 

wpForoAttachments->get_sizes()

 

Any ideas on how to resolve it? 

9 Replies
I Give Up
Posts: 296
Customer
Topic starter
(@percysgrowroom)
Member
Joined: 7 years ago

Can anyone help with this? 

 

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

Famed Member
Posts: 4233

@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
I Give Up
Customer
(@percysgrowroom)
Joined: 7 years ago

Member
Posts: 296

@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
I Give Up
Customer
(@percysgrowroom)
Joined: 7 years ago

Member
Posts: 296

@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: 10 years ago

Famed Member
Posts: 4233

@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
I Give Up
Customer
(@percysgrowroom)
Joined: 7 years ago

Member
Posts: 296

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

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

Famed Member
Posts: 4233

0%,

In any case you can back up the wp_wpforo_attachments table 

Reply
I Give Up
Posts: 296
Customer
Topic starter
(@percysgrowroom)
Member
Joined: 7 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: 10 years ago

Famed Member
Posts: 4233

@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