Created
December 2, 2013 08:43
-
-
Save lirantal/7746730 to your computer and use it in GitHub Desktop.
Improving on OG (Organic Groups) module optimization - makes no sense to add an ORDER BY clause to the query which hinders on performance and not being used at all in the loop iteration for the object building.
This file contains 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
diff --git a/src/drupal/profiles/drupal_commons/modules/contrib/og/og.module b/src/drupal/profiles/drupal_commons/modules/contrib/og/og.module | |
index 74d4f42..545575e 100644 | |
--- a/src/drupal/profiles/drupal_commons/modules/contrib/og/og.module | |
+++ b/src/drupal/profiles/drupal_commons/modules/contrib/og/og.module | |
@@ -894,7 +894,7 @@ function og_get_subscriptions($uid, $min_is_active = 1, $reset = FALSE) { | |
array_unshift($types, $min_is_active); | |
array_unshift($types, $uid); | |
- $sql = "SELECT n.title, n.type, n.status, ou.* FROM {og_uid} ou INNER JOIN {node} n ON ou.nid = n.nid WHERE ou.uid = %d AND ou.is_active >= %d AND n.type $in ORDER BY n.title"; | |
+ $sql = "SELECT n.title, n.type, n.status, ou.* FROM {og_uid} ou INNER JOIN {node} n ON ou.nid = n.nid WHERE ou.uid = %d AND ou.is_active >= %d AND n.type $in"; | |
$result = db_query($sql, $types); | |
while ($row = db_fetch_array($result)) { | |
$subscriptions[$uid][$min_is_active][$row['nid']] = $row; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment