Hi,

I know the following two queries came from Taxonomy Views, but I'm not sure what would trigger them:

SELECT count(node.nid) FROM {node} node LEFT JOIN {term_node} term_node ON node.nid = term_node.nid WHERE (term_node.tid IS NULL);

SELECT node.nid, term_node.nid AS term_node_nid FROM {node} node LEFT JOIN {term_node} term_node ON node.nid = term_node.nid WHERE (term_node.tid IS NULL) ORDER BY term_node_nid DESC LIMIT 0, 10;

It looks like the queries are trying to get all nodes that have no terms, but I didn't specifically created a view for it. I don't how it's even being accessed. Any idea? Thanks!

I'm trying to stop those queries from being executed because I really have no use for them. Since pretty much every node I have has tags, the result of that both of those queries should be nothing.

Comments

dawehner’s picture

You be debug_backtrace started from db_query.

sinmao’s picture

Hi Dereine,

Thanks for the reply. I got those queries off the the slow query log, so I don't know where they're coming from. I know it's from Taxonomy Views, but I don't know which page is calling it. There's no error message, they're just very slow queries.

If I use debug_backtrace in db_query, I would have to go a page on the website to see the output, right? That's the problem, I don't even know what page is calling it.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Those queries are built views, so all you can really do is go through and run your views. If you were using Drupal 6 you could turn on the feature that tags queries with which view they came from but D5 doesn't support that. All you can do is look and investigate further.

sinmao’s picture

Hi Merlin,

I know they came from the default Taxonomy View. I've added filters to that view and saw it reflected in those two queries. The only problem is I have no idea which link on the site would call up those queries - select all nodes without taxonomy terms.

I went to pager.inc to do a match for the count query and ignore it if there's a match, but I still see a couple of them in my slow query log.