Skip to content

Data organization

scribu edited this page Sep 21, 2011 · 6 revisions

The plugin data organization went through several iterations.

Version 0.1 simply used custom fields to store connections. This turned out to be slow, because the wp_postmeta.meta_value column is defined as longtext, with no index.

Version 0.3 switched to using a hidden taxonomy. This worked reasonably well, even though the queries were pretty strange.

From version 0.4 onwards, two custom tables are used:

wp_p2p:
  - p2p_id
  - p2p_from
  - p2p_to
wp_p2pmeta:
  - p2p_id
  - meta_id
  - meta_key
  - meta_value

This results in simple and efficient queries, as well as the ability to add additional information per connection, using the familiar metadata API.

Clone this wiki locally