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

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

    XMLWordPrintable

Details

    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

            dhruv.goel92 Dhruv Goel [X] (Inactive)
            bantu Andreas Fischer [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: