[wp-trac] [WordPress Trac] #14513: Time for a wp_post_relationships table?

WordPress Trac wp-trac at lists.automattic.com
Tue Dec 14 02:52:00 UTC 2010


#14513: Time for a wp_post_relationships table?
-----------------------------+----------------------------------------------
 Reporter:  mikeschinkel     |        Owner:                
     Type:  feature request  |       Status:  reopened      
 Priority:  normal           |    Milestone:  Future Release
Component:  Post Types       |      Version:  3.0.1         
 Severity:  normal           |   Resolution:                
 Keywords:                   |  
-----------------------------+----------------------------------------------
Changes (by jwriteclub):

 * cc: jwriteclub (added)


Comment:

 If we accept the custom post types are WordPress' equivalent of a
 "relation" (relations are viewed as "tables"[1]) in the relational model
 for "large shared data banks" as written about by E. F. Codd in 1970[2]
 then this pattern is one of the most fundamental pattern in relational
 databases that exist. This concept is fundamental to every relational
 database system ever built, not some "edge" use case.

 mikeschinkel absolutely captures the case of custom posts. However it goes
 beyond this. Wordpress, to all intents and purposes, no longer uses SQL as
 a Relation Database Management System, but rather, uses SQL as a data
 store for a custom relational model which just so happens to use SQL as
 the storage layer. Sure, Wordpress makes use of indexes and other features
 to speed up access, but these could be used if Wordpress stored its data
 in a B-Tree, or any other structure.

 Custom posts ''are'' Relations, and more importantly, so are the
 Relationships between Relations (at least in the relational model)*. The
 ability to arbitrarily link Relations is fundamental to the relational
 model.

 Less abstractly there are a multitude of use cases which require this
 functionality and, more importantly, it is a significantly missing piece
 to Wordpress having a complete data model.

 Implementation wise, I have built this out in my own sites by using an
 additional table, as relating on taxonomies simply imposes too great an
 overhead for large scale use.

 * Just a note: a Relation is a n-Tuple of data, whereas a Relationship is
 the logical connection between tuples, which is, itself, also a Relation.

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


More information about the wp-trac mailing list