[buddypress-trac] [BuddyPress Trac] #5341: Avoid bloat in the activity table when recording blog post activity items
buddypress-trac
noreply at wordpress.org
Fri Jan 17 12:26:44 UTC 2014
#5341: Avoid bloat in the activity table when recording blog post activity items
--------------------------+-----------------------------
Reporter: henry.wright | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version:
Severity: normal | Keywords:
--------------------------+-----------------------------
Currently the content of a new blog post is recorded to the database
twice. Once in the BP activity table by function
{{{bp_blogs_record_post}}} and once in the {{{wp_posts}}} table.
I'm wondering if this is unnecessary?
In {{{bp_blogs_record_post}}}, the {{{bp_blogs_record_activity}}} function
records the {{{$post_id}}} as the {{{secondary_item_id}}} so if the
content is needed at a later date then the content can be fetched from the
{{{wp_posts}}} table via something like this:
{{{
$post = get_post( $post_id );
$excerpt = $post->post_excerpt;
$content = $post->post_content;
}}}
This makes it unnecessary for {{{bp_blogs_record_activity}}} to record
blog post content.
The same approach to avoiding saving duplicate data could be taken for
blog comments. As a result, the size of the activity table wouldn't grow
as quickly.
Thoughts?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5341>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list