[development] problem with db_rewrite_sql

Nancy Wichmann nan_wich at bellsouth.net
Tue Nov 24 14:07:30 UTC 2009


Lluis wrote:
> Is there any reason why using "INNER JOIN" is better than using
> "WHERE nid IN (SELECT ... FROM {node_access} ... )"?

I think it was Larry Garfield who answered this yesterday or the day before.
The SELECT clause is going to be executed for each node that otherwise
matches the conditions. In the case of a larger site, that could result in a
LOT of overhead. You might be better off doing a separate query to get the
IN list and use db_placeholders to make the query.

Nancy E. Wichmann, PMP 
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King,
Jr.




More information about the development mailing list