[wp-hackers] to_ping query optimization

Casey Bisson casey.bisson at gmail.com
Sat Jan 12 16:52:58 GMT 2008


Thanks for the sanity check. Here's my ticket with attached patch:

http://trac.wordpress.org/ticket/5649

As this is my first submitted patch, I can now join the ranks of  
people on the list asking when it'll get committed ;)


On Jan 11, 2008, at 6:33 PM, Andy Skelton wrote:

> On Jan 11, 2008 5:00 PM, Casey Bisson <casey.bisson at gmail.com> wrote:
>> It works beautifully when written as below, but what am I losing? How
>> important is the "CHAR_LENGTH(TRIM(to_ping)) > 7" piece?
>>
>> $trackbacks = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE
>> to_ping <> '' AND post_status = 'publish'");
>
> Hey Casey! Your query looks great to my eyes. I would guess that the
> existing code was written to avoid selecting rows full of spaces or
> shorter than 'http://' (7 chars). It would be more efficient to a) use
> your query, and b) make sure the field is empty when all valid pings
> have been sent.
>
> Could you create a trac ticket and upload a patch with your changes?
>
> Andy
> _______________________________________________
> wp-hackers mailing list
> wp-ha



More information about the wp-hackers mailing list