| home | forums | resources | search | news | join | members: 5931 |
| Join and Post Now! Get frontpage placement and link to your blog or website. Ask questions or give advice on content management systems. |
Drupal - Speeding up taxonomy_term_node_countlogged in as - Anonymous Drupals taxonomy node count function takes too much time to process. The problem is that the design is not optimized for use with a large number of terms and hundreds of thousands of nodes. Here is the devel read out for the process. 734.89ms 1 taxonomy_term_count_nodes
SELECT t.tid, COUNT(n.nid) AS c FROM term_node t INNER JOIN node n ON t.nid = n.nid LEFT JOIN i18n_node i18n ON n.nid = i18n.nid WHERE (i18n.language ='sv' OR i18n.language ='' OR i18n.language IS NULL) AND ( n.status = 1 ) GROUP BY t.tid
<?phpAs you can see there is a JOIN between two tables that can have an incredible amount of rows on a large and busy website. The term_node table which is used in the query is also one that cannot be normalised as it is a join table of sorts. Caching does not work in this case because the number of nodes per term is a dynamic value. My idea is to change the taxonomy node save function to have it save/delete to a term_node_count table. This table would allow for a single query to be used and speed things up tremendously. This would involve changes in: taxonomy_save_term
Site categories: Web Developer |
PHP London Hotels
Web Developers Laptop Reviews
PHP Just Dial International Calls
Adobe Flex Web Developers Excel Training Courses
PHP excel courses in london
Web Developers Data Recovery
Content Management Systems Cheap Personal & Secured Loans
PHP Sell Online
|
NewsletterGet updates on Hiveminds services, articles and downloads by signing up for the newsletter. |
Editor's choiceSome of the better articles, stories and tutorials found at Hiveminds. |
Find moreFind more of Hiveminds articles, stories, tutorials and user comments by searching. |
Picked linksHand picked websites and articles from around the web that provide quality reading. |