MySQL Forums
Forum List  »  Newbie

Twenty Gig temporary table?
Posted by: John Woodward
Date: May 21, 2018 06:31PM

I used MySQL for a few years a decade ago, but now I'm getting back into it, mostly still playing with the employees sample database. This morning I tried this query:

SELECT
e.last_name,
e.first_name,
e.emp_no,
s.salary
FROM
employees AS e,
salaries AS s
WHERE
e.first_name LIKE '%z%'
OR
e.first_name LIKE '%x%'
ORDER BY
s.salary DESC,
e.last_name
;

The query ran on a Ubuntu netbook and I sat and used Disk Usage Analyzer to watch my available HD space drop from 20.8G to 1.5G, presumably because the temporary file(s) were growing so big. At about 15 minutes, I got:

ERROR 1114 (HY000): The table '/tmp/#sql_3e3_0' is full

I know the employees database is large, but almost 20G of temporary files seems impossibly wrong. Can somebody tell me what I did wrong in the query?

Options: ReplyQuote


Subject
Written By
Posted
Twenty Gig temporary table?
May 21, 2018 06:31PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.