I have a huge table containing 14 million + rows. All varchar data. I am trying to run this query. I get output quickly. limit is set on 800K records only.
SELECT *
FROM (SELECT unique_user_id, url, count(url) as url_visit_count, categories, count(categories) as count
FROM ph_usertrack_data GROUP BY unique_user_id LIMIT 800000) a
ORDER BY a.url_visit_count DESC LIMIT 100;
when I put limit to 1 million records, I get this error
Incorrect key file for table '/tmp/#sql_6663_0.MYI'; try to repair it
My temp folder is having a lot of space around 100 GB, so no space issue. Why this issue appears when I increase number of rows to process?