• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

How to Fix MySQL Error 1104 – SQLSTATE: 42000 (ER_TOO_BIG_SELECT) The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay

December 20, 2023

How to Fix MySQL Error 1104 – SQLSTATE: 42000 (ER_TOO_BIG_SELECT)

MySQL is a popular open-source relational database management system used by many websites and applications. However, like any software, it can encounter errors that can disrupt its normal operation. One such error is MySQL Error 1104 – SQLSTATE: 42000 (ER_TOO_BIG_SELECT). This error occurs when a SELECT statement would examine more rows than the maximum join size allows. In this article, we will explore the causes of this error and provide solutions to fix it.

Understanding MySQL Error 1104

When you encounter MySQL Error 1104, you will see the following error message:

The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay

This error message indicates that the SELECT statement you are trying to execute would examine more rows than the maximum join size allows. The maximum join size is determined by the value of the max_join_size system variable, which is set to a default value of 4,294,967,295 rows. If your SELECT statement exceeds this limit, you will encounter the ER_TOO_BIG_SELECT error.

Possible Causes of MySQL Error 1104

There are several reasons why you might encounter MySQL Error 1104:

  • Large Tables: If your database contains large tables with millions of rows, it is more likely that your SELECT statement will exceed the maximum join size.
  • Complex Joins: If your SELECT statement involves complex joins that require examining a large number of rows, it can trigger the ER_TOO_BIG_SELECT error.
  • Missing or Incorrect WHERE Clause: If your SELECT statement does not have a proper WHERE clause or if the WHERE clause is incorrect, it can result in examining more rows than necessary.

Fixing MySQL Error 1104

To fix MySQL Error 1104, you can try the following solutions:

1. Optimize Your Query

Review your SELECT statement and optimize it to reduce the number of rows examined. Consider adding a WHERE clause to limit the result set or optimizing your joins to minimize the number of rows involved in the query.

2. Increase the Maximum Join Size

If optimizing your query is not feasible or does not resolve the issue, you can increase the maximum join size by modifying the max_join_size system variable. You can do this by executing the following SQL statement:

SET SQL_MAX_JOIN_SIZE = value;

Replace value with the desired maximum join size. Keep in mind that setting it to an excessively high value can impact server performance and memory usage.

3. Enable SQL_BIG_SELECTS

If your SELECT statement is valid and you are confident that it will not cause performance issues, you can enable the SQL_BIG_SELECTS mode. This mode allows SELECT statements to examine more rows than the maximum join size. You can enable it by executing the following SQL statement:

SET SQL_BIG_SELECTS = 1;

Enabling this mode should be done with caution, as it can potentially lead to performance problems if used improperly.

Summary

MySQL Error 1104 – SQLSTATE: 42000 (ER_TOO_BIG_SELECT) occurs when a SELECT statement would examine more rows than the maximum join size allows. To fix this error, you can optimize your query, increase the maximum join size, or enable the SQL_BIG_SELECTS mode. If you encounter this error, it is important to review your query and make the necessary adjustments to ensure efficient and effective database operations.

For reliable and high-performance VPS hosting solutions, consider Server.HK. Our hosting services are designed to meet the needs of businesses and individuals, providing excellent performance and reliability for your websites and applications.

Recent Posts

  • Hong Kong VPS Security Checklist: 10 Steps to Harden Your Server in 2026
  • NVMe SSD vs SATA SSD for VPS Hosting: Does Storage Type Really Matter?
  • Hong Kong VPS Docker Setup: Run Containers with Full Root Access
  • How to Set Up a Game Server on Hong Kong VPS: Low-Latency Gaming for Asia
  • How to Deploy a Node.js Application on Hong Kong VPS: Complete Guide

Recent Comments

  1. ivermectina tabletas on Top 5 Use Cases for a Hong Kong Dedicated Server in 2026
  2. hello world on Top 5 Use Cases for a Hong Kong Dedicated Server in 2026

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot