[Bb-trac] Re: [bbPress] #689: More flexible joining of topic meta tables in BB_Query class

bbPress bb-trac at lists.bbpress.org
Fri Jul 13 00:55:18 GMT 2007


#689: More flexible joining of topic meta tables in BB_Query class
-------------------------+--------------------------------------------------
 Reporter:  sambauers    |        Owner:  mdawaffe         
     Type:  enhancement  |       Status:  new              
 Priority:  high         |    Milestone:  0.8.3 & XML-RPC  
Component:  Back-end     |      Version:  1.0-alpha (trunk)
 Severity:  major        |   Resolution:                   
 Keywords:  has-patch    |  
-------------------------+--------------------------------------------------
Comment (by mdawaffe):

 There is another way to do this for your specific plugin.

 Instead of storing meta_value = 'no', you could delete the meta_key =
 'topic_resolved' for that topic.  Then you could just

 {{{
 $query = array(
         'sticky' => 'all',
         'meta_key' => '-topic_resolved'
 );
 }}}

 I'm not sure what other impacts this might have on your plugin.

 (I admit that

 {{{
 $query = array(
         'sticky' => 'all',
         'meta_key' => 'topic_resolved',
         'meta_value' => 'NULL' // or even better 'meta_value' => NULL
 );
 }}}

 makes a little more sense, and your patch could let that happen.)

 Switching to LEFT JOIN for every topicmeta join means we'd have to default
 to {{{AND $field IS NOT NULL}}} for every such query.  I don't know what
 impact (good or bad) that would have on overall efficiency for those
 queries.

 Also, shouldn't your patch read

 {{{
 if ( $not_null_flag )
         $r .= " AND $field IS NOT NULL)";
 }}}

 on patched line 682 (instead of OR)?

-- 
Ticket URL: <http://trac.bbpress.org/ticket/689#comment:1>
bbPress <http://bbpress.org/>
Innovative forum development


More information about the Bb-trac mailing list