[development] Everything's a node != Everything's in 1 table

Larry Garfield larry at garfieldtech.com
Tue Jan 23 02:48:45 UTC 2007


On Monday 22 January 2007 7:59 pm, Edgar Whipple wrote:

> Here's what I have in mind.
>
> 1. Put each node type in its own table, and name the table for the type,
> e.g. {node_footype}. Each node-type table will have columns for the
> fields that are absolutely universal to all nodes, at a minimum the
> globally unique node ID, plus timestamps, etc. Note that the node type
> is not stored in a column in this table, as it is invariant across rows;
> the typename is implicit in the table name. (In memory, of course, a
> node's type identifier would need to be recorded.)

And right there you lose the ability to treat a node as "just a node", because 
the node data is so spread out.  You can't easily "find all nodes created 
after time X", because there's n different tables you have to search.  

(The system I use at work is broken down like that.  It's nasty.)  

Of course, the flip side of the current system is that loading a node becomes 
very expensive because you have to load from the node table, then figure out 
what the node type is from that  and then load data from another table, then 
potentially make other queries to load other fields.  Unfortunately I don't 
know of any fancy SQL to determine a table to join against dynamically.  
(That would be ideal.)

And of course, I'm seeing a trend toward more CCK-esque nodes, which means 
fields get split out into separate tables to allow for richer data types and 
multi-value fields.  That complicates things in an entirely different way.

-- 
Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


More information about the development mailing list