[wp-hackers] Consolidating database tables and other assorted items

Computer Guru computerguru at neosmart.net
Mon Apr 9 19:59:31 GMT 2007


I fully agree with all the points your making with regards to query
complexity..
But I firmly believe that the slight overhead introduced by database
abstraction is more than made up for by the more streamlined queries.
Obviously streamlined queries w/o database abstraction is even better, but 1
statement with 2 joins is by far much more efficient than 4 queries....

Computer Guru
NeoSmart Technologies
http://neosmart.net/blog/


> -----Original Message-----
> From: wp-hackers-bounces at lists.automattic.com [mailto:wp-hackers-
> bounces at lists.automattic.com] On Behalf Of Steve Lewis
> Sent: Monday, April 09, 2007 10:56 PM
> To: wp-hackers at lists.automattic.com
> Subject: Re: [wp-hackers] Consolidating database tables and other
> assorted items
> 
> On 4/9/07, Computer Guru <computerguru at neosmart.net> wrote:
> >
> > Thank you Robert!
> 
> +1
> Brilliant.
> 
> 
> Database normalization almost always equals more tables - but hundred-
> fold
> > flexibility.
> >
> 
> More tables, I agree.  Flexibility?  I don't know about that.
> 
> I'm sure I missed one or two important things, but how a post +
> comments =
> > 20 queries on a stock WP *without a single plugin* is beyond me.
> >
> > The thing is - since the WP data is well distributed and properly
> stored
> > (the WP db-structure is fairly well done, with the exception of
> foreign keys
> > IMO) why does it take so many queries to do so little?
> 
> 
> Normalization increases the complexity of data retrieval, and therefore
> the
> complexity of the queries necessary.  The point of normalization is not
> to
> simplify but to promote data integrity.  With that level of complexity,
> either you have to perform more queries, or more join operations within
> your
> queries.  The WP API discourages joins, generally.  That is why it
> takes 20
> queries to do so little.
> 
> You would have to begin de-normalizing the database, or consider using
> views, to reduce the number of queries per page without cutting
> features.
> 
> I think if WP ever gets a database abstraction layer - even if it's
> > something as heavy as MDB2/PearDB - it'll perform *better* since a
> hell of a
> > lot of queries will be consolidated.
> 
> 
> I doubt that.  I seriously doubt that.  Especially because it makes it
> harder to perform the optimal joins for the current context.
> Abstractions
> in the middleware defeat the value of the RDBMS.  That is just the way
> it is
> in my experience.
> 
> I would love to know why I am wrong.
> 
> --
> SteveL
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list