Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11445

Suboptimal number of query complexity in phpbb_notification_manager::get_global_subscriptions()

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-dev
    • Fix Version/s: 3.1.0-RC1
    • Component/s: Notification System
    • Labels:
      None

      Description

      Query in a two-dimensional loop. This already accounts for 1/2 of the queries on https://area51.phpbb.com/phpBB/ucp.php?i=ucp_notifications&mode=notification_options and scales poorly when new notification methods or types are added.

      		foreach ($this->get_subscription_types() as $group_name => $types)
      		{
      			foreach ($types as $id => $type)
      			{
      				$sql = 'SELECT method, notify
      					FROM ' . $this->user_notifications_table . '
      					WHERE user_id = ' . (int) $user_id . "
      						AND item_type = '" . $this->db->sql_escape($id) . "'
      						AND item_id = 0";
      				$result = $this->db->sql_query($sql);
      

        Attachments

          Activity

            People

            • Assignee:
              dhruv.goel92 Dhruv Goel
              Reporter:
              bantu Andreas Fischer
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: