Error
Error Code:
4120
MySQL Error 4120: INTERSECT ALL Duplicate Limit
Description
This error indicates that a SQL query using `INTERSECT ALL` has exceeded MySQL's internal limit for managing duplicate rows. It typically occurs when processing very large datasets or complex queries that produce an excessive number of identical rows across the intersected result sets.
Error Message
Max number of duplicate rows in INTERSECT ALL exceeded.
Known Causes
3 known causesExcessive Duplicate Rows
The `INTERSECT ALL` operation is processing a query that generates an unusually large number of identical rows across the intersected result sets, exceeding MySQL's internal limit.
Processing Large Datasets
Queries involving tables with millions or billions of rows can easily generate intermediate results that exceed internal duplicate row limits, especially with `INTERSECT ALL`.
Inefficient Query Design
Poorly optimized or overly complex SQL logic, particularly with multiple nested operations before `INTERSECT ALL`, can lead to an unexpected explosion of duplicate rows.
Solutions
Coming SoonGeneral Troubleshooting Tips
- Check the error message carefully for specific details
- Review recent changes that might have caused the error
- Search for the exact error code in the official documentation
- Check log files for additional context
- Try restarting the application or service