Hi!

While developing a new module I came accross a performance issue. I need to discover the node creation date, but also information from other two tables. I could make a triple join, I guess, but I haven't see this kind of thing in drupal. Usually, the third column/table is taken on a while()/foreach() loop, and this might add too much sql queries. So does anyone have something against complex joins or am I being to conservative?

Also, is there a function or a way to discover what nodes are part of a taxonomy vocab or term? Because I just coded them to excluded nodes that aren't returned from the functions, but I was just curious if there's an established method already.

Comments

Anonymous’s picture

if i remember right, the taxonomy call that you seek was omitted from the API. I suggest you write the function, and submit a patch to the devel list. if you can't be bothered, just look at taxonomy_html function wherewe retrieve the count of all nodes for each term (you will want the nids for each term, but the idea is the same).

teamonkey’s picture

There's a triple join in the image module. Causes all sorts of problems with PostgreSQL, but I'm pretty sure that PostgreSQL supports triple joins. Unfortuately, my SQL isn't quite up to scratch.

This node explains the errors I get.

[teamonkey]