'Why am I unable to Left Join two tables?

This is the query that I have performed.

select *
from samples
left join ETL_freemark on samples.lab_number_code=ETL_freemark.Lab_Number;

Both tables have only about 1,000,000 rows in it. 'Samples' table is able to left join easily with other tables.

It is only when it is left joined to 'ETL_freemark' that is returning with the

Error Code: 2013. Lost connection to MySQL server during query 30.016 sec

After increasing DBMS connection keep-alive interval/read timeout/connection timeout to 3000 seconds and making indexes for samples.lab_number_code and for ETL_freemark_Lab_number this error comes out instead

Error Code: 1105. The last transaction was aborted due to Seamless Scaling. Please retry. 44.266 sec"

And these 3 queries work fine.

select *
from samples

and

select *
from ETL_freemark

and

select *
from samples
inner join ETL_freemark on samples.lab_number_code=ETL_freemark.lab_number

Using explain select results are these:

explain select *
        from samples
        left join ETL_freemark on samples.lab_number_code=ETL_freemark.Lab_Number;
1   SIMPLE  samples             ALL                 132440  100.00  
1   SIMPLE  ETL_freemark        ALL                 179093  100.00  Using where; Using join buffer (Block Nested Loop)

Any ideas on why my left join is not working?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source