Skip to:
Content

bbPress.org

Opened 11 years ago

Last modified 8 years ago

#2533 new enhancement

Optimize Repair Tools SQL Queries

Reported by: netweb's profile netweb Owned by: netweb's profile netweb
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.5
Component: Tools Keywords: needs-unit-tests needs-refresh
Cc:

Description

Optimize Repair Tools SQL Queries | bbPress -> Tools - Repair Tools

Attachments (3)

2533.1.diff (3.5 KB) - added by netweb 11 years ago.
2533.2.diff (3.8 KB) - added by netweb 11 years ago.
Patch for _bbp_last_active_id & _bbp_last_active_time
2533.3.diff (4.2 KB) - added by netweb 11 years ago.

Download all attachments as: .zip

Change History (23)

@netweb
11 years ago

#1 @netweb
11 years ago

  • Keywords needs-testing added

In 2533.1.diff

Combine existing two SQL queries to a single SQL query for Topics _bbp_last_active_id

Query times based on ~2,500 Topics with ~5,000 replies total ~33% performance increase

Original queries total time - Total Query Time: 180.5ms (Part 1 - 92.1ms & Part 2 88.4ms)

New single query - Total Query Time: 119.0ms*/

Last edited 11 years ago by netweb (previous) (diff)

@netweb
11 years ago

Patch for _bbp_last_active_id & _bbp_last_active_time

#2 @netweb
11 years ago

In 2533.2.diff added _bbp_last_active_time

Combine existing two SQL queries to a single SQL query for Topics _bbp_last_active_time

Query times based on ~2,500 Topics with ~5,000 replies total ~50% performance increase

Original queries total time - Total Query Time: 95.3ms (Part 1 - 43.9ms & Part 2 51.4ms)

New single query - Total Query Time: 44.5ms*/

@netweb
11 years ago

#3 @netweb
11 years ago

In 2533.3.diff
Fix bbp_admin_repair_topic_voice_count() where the count was including the reply custom post type, causing SQL errors and terminating the function early before the count was completed.

#4 @netweb
11 years ago

Related: #2353

#5 @netweb
11 years ago

  • Milestone changed from Awaiting Review to 2.6

Moving to 2.6, irrespective of how #1925 is implemented this is good to go.

This ticket was mentioned in IRC in #bbpress-dev by netweb. View the logs.


11 years ago

#7 @netweb
10 years ago

  • Owner set to netweb

This ticket was mentioned in IRC in #bbpress-dev by netweb. View the logs.


10 years ago

#9 @netweb
9 years ago

  • Keywords needs-unit-tests added; needs-testing removed

We should be including bbp_update_topic_anonymous_reply_count() in the repair tool counts.

Will update patch with unit tests ;)

#10 @netweb
9 years ago

In 5831:

Tests: Add admin tools test test_bbp_admin_repair_topic_voice_count() for bbp_admin_repair_topic_voice_count()

Props netweb. See #2533

This ticket was mentioned in Slack in #bbpress by netweb. View the logs.


9 years ago

#12 @netweb
9 years ago

Related: #2876

This ticket was mentioned in Slack in #bbpress by netweb. View the logs.


9 years ago

#14 follow-up: @Destac
8 years ago

Is there anything left that needs to be done in this ticket other than testing?

#15 in reply to: ↑ 14 ; follow-up: @netweb
8 years ago

Replying to Destac:

Is there anything left that needs to be done in this ticket other than testing?

Yes, the unit test test_bbp_admin_repair_freshness() for bbp_admin_repair_freshness() needs to be created before merging the outstanding patch in 2533.3.diff

#16 in reply to: ↑ 15 ; follow-up: @Destac
8 years ago

What's the procedure to help with testing i would love to help

#17 in reply to: ↑ 16 @netweb
8 years ago

Replying to Destac:

What's the procedure to help with testing i would love to help

For this ticket, PHPUnit, it's outlined in the WordPress core handbook:

https://make.wordpress.org/core/handbook/testing/automated-testing/phpunit/

If this is something you're familiar with then some help would be fantastic.

We also have what we call "Good First Bugs" that are great introductions to contributing, these bugs are a great way to get started, you can see a list of the "open tickets" here: https://bbpress.trac.wordpress.org/query?status=!closed&keywords=~good-first-bug

#18 @johnjamesjacoby
8 years ago

We aren't actually using _bbp_anonymous_reply_count anywhere. Maybe we don't have to?

#19 @johnjamesjacoby
8 years ago

  • Milestone changed from 2.6 to 2.7

Bump to 2.7. What's in is good, and what's left doesn't appear critical.

#20 @netweb
8 years ago

  • Keywords needs-refresh added

Patch will need a refresh and unit tests, adding some refreshed performance stats would also be nice

Note: See TracTickets for help on using tickets.