[wp-trac] [WordPress Trac] #18822: get_permalink() produces an add. DB request without $post->filter

WordPress Trac wp-trac at lists.automattic.com
Fri Sep 30 13:11:08 UTC 2011


#18822: get_permalink() produces an add. DB request without $post->filter
-------------------------+------------------------------
 Reporter:  F J Kaiser   |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Performance  |     Version:  3.2.1
 Severity:  major        |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Comment (by duck_):

 Replying to [comment:5 F J Kaiser]:
 > If you look closer at the code (in core & on wpse) you'll see that
 there's the filter name 'sample' required.

 I think you misunderstood what I was saying or I misread the original
 ticket description. I was pointing out that a call to get_post() doesn't
 necessarily incur an additional database query as it will try to use the
 cache when possible, versus "additional query $post = &get_post($id) ...
 This means that you'll get one additional query" from the description.

 Replying to [comment:6 scribu]:
 > Not necessarily

 I was trying to be vague in my guesswork on the methodology as I'm aware
 there are other methods this can occur. My mistake as that wasn't clear
 enough.

 > It should check if the filter is 'raw' before going off and
 [potentially] doing another query

 That seems to make sense.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18822#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list