[wp-trac] [WordPress Trac] #10655: Post/Page ID Count skips one number when a new page or post created in WordPress 2.8.2

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 21 18:16:56 UTC 2009


#10655: Post/Page ID Count skips one number when a new page or post created in
WordPress 2.8.2
--------------------------+-------------------------------------------------
 Reporter:  misty9        |        Owner:          
     Type:  defect (bug)  |       Status:  reopened
 Priority:  low           |    Milestone:          
Component:  General       |      Version:  2.8.2   
 Severity:  minor         |   Resolution:          
 Keywords:                |  
--------------------------+-------------------------------------------------

Comment(by strider72):

 Neither of you have addressed the issue in the bug.

   1. I use the post/page IDs to easily track which page I am updating.
 Disabling Post Revision is NOT applicable here.

 You are using the IDs for something they aren't meant for.  That isn't a
 bug, even if it inconveniences you.

 Beyond that, disabling post revisions *does* apply, because it restores
 the behavior you want -- one post/page == one ID number.  The reason the
 ID numbers are jumping on you is that each revision gets a new ID number.

 I agree with you to an extent -- I'm not a fan of how the revision system
 affects IDs.  But disabling revisions does fix that.

   2. "Post IDs are used internally for a number of things. They are not
 guaranteed to be consecutive."

   Because "Post IDs are used internally for a number of things", it does
 NOT mean an efficient SQL programming practice is not necessary for this
 basic WP functionality to work correctly.

 How is it inefficient?  Your main complaint in the bug report is simply
 that the ID number does not show an accurate tally of how many active
 posts there are.  This is true, but again it isn't meant for that.
 Putting revisions in the same table as actual posts is fairly efficient to
 my mind, considering the alternative would be to have a duplicate table
 for holding revisions separate from posts.

   If SQL code works correctly, the post/past IDs indicate the actual total
 number of posts/pages in a given site.  Currently, the post IDs are twice
 as many as the total number of the posts or pages.  This is a bug whether
 the Post IDs are used for internally or otherwise.

 A false assertion.  You are claiming, as a matter of definition, that ID
 == post.  This is not how the system works.  It's note a bug, merely a
 difference in methodology.

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


More information about the wp-trac mailing list