Skip to content

Notification query needs tuning - can encounter MAX_JOIN_SIZE issues #7661

@sbulen

Description

@sbulen

Description

One of the main notifications queries sometimes goes all cartesian & causes the following error in the logs:
Database Error: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay

Adding an index on id_board on log_notify addresses the issue.

From the forum:
https://www.simplemachines.org/community/index.php?topic=584569.0

The query may be found here:

Steps to reproduce

  1. I think we've only seen this happen when the host has put a strict low value on MAX_JOIN_SIZE. (7000000 in the forum example.)

Environment (complete as necessary)

  • Version/Git revision: 2.1.3
  • Database Type: MySQL
  • Database Version: 8.0
  • PHP Version: 8.1

Additional Information:

Screenshot 2022-12-27 173916

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions