I really like the simplicity of node handling, but if it as indulgence compared to a simple SQL query that gets me the same information (just an ID or something similar), then I'd use a query.

Is there a big difference in performance?

Comments

AjK’s picture

Sure you can query the node tables direct. But will you remember to do the db_rewrite_sql() stuff to ensure node access rights are maintained, are you going to remember to check node_access(), how do you intend to call hook_nodeapi() so modules get a look in to add their data to the $node object ?

If you can remember to do all that (and the things I missed) and track Core to make sure you don't miss anything in future that comes in, fine, direct query is the solution. Failing that, you can always use the API, it's there to make sure none of that get's missed :)

That's what APIs are for :)