Created
May 19, 2010 13:37
-
-
Save hugowetterberg/406315 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Given a table term_article_count(tid, node_count) | |
# the following could be executed to refresh a node count cache. | |
TRUNCATE term_article_count; | |
INSERT INTO term_article_count(tid, node_count) | |
SELECT tn.tid, COUNT(n.nid) | |
FROM term_node AS tn | |
INNER JOIN node AS n ON (tn.vid=n.vid AND n.type='location' AND n.status=1) | |
GROUP BY tn.tid; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment