We're currently developing a site which has a very large taxonomy (>2M terms). The site is able to work as we're using the Leftandright module, and other associated modules.

When trying to view an image gallery, a call is made to _taxonomy_term_children() which fails as it tries to parse through all 2M plus terms and insert them into an array. The patch supplied works round this, increasing the number of SQL queries required, but no more than a drupal_get_tree call would.

CommentFileSizeAuthor
taxonomy_term_children.patch859 bytessdrycroft
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sdrycroft’s picture

I should add that the Image gallery is not using the 2M term vocabulary, but is instead using a single term vocabulary.

catch’s picture

This was refactored in #144969: taxonomy_term_count_nodes returns wrong count (+ tests) which is waiting for a backport. Does image.module call _taxonomy_term_children() directly or use taxonomy_term_count_nodes()

sdrycroft’s picture

It uses taxonomy_term_count_nodes.

catch’s picture

Would you mind testing the latest patch on #144969: taxonomy_term_count_nodes returns wrong count (+ tests) to see if it helps? That's more likely to get committed since it's pretty much the same as the code in HEAD now - but it's not used in core, and we didn't test it on large datasets, just made sure the counts were right.

Gábor Hojtsy’s picture

Version: 6.9 » 7.x-dev
Priority: Critical » Normal
Issue tags: +Performance

@catch: not sure how is taxonomy_term_count_nodes() related to taxonomy_term_children()? Looks like this independent improvement would be useful for D7 and then backported to D6.

Status: Needs review » Needs work

The last submitted patch, taxonomy_term_children.patch, failed testing.

catch’s picture

Version: 7.x-dev » 6.x-dev

http://api.drupal.org/api/function/_taxonomy_term_children/6

Does not exist in Drupal 7, because it existed only as a helper function for taxonomy_term_count_nodes() which was refactored, then itself removed from D7.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.