DB Error: selectSingle query failed

SELECT DISTINCT companies.* FROM companies LEFT JOIN directory_categories_has_companies ON directory_categories_has_companies.companies_id = companies.id LEFT JOIN directory_categories ON directory_categories.id = directory_categories_has_companies.directory_categories_id LEFT JOIN directory_categories AS directory_categories_parent ON directory_categories.parent_id = directory_categories_parent.id LEFT JOIN contacts ON contacts.companies_id = companies.id WHERE companies.uri = 'old-moores-almanac'

Can't create/write to file '/tmp/#sql_c0a_1.MAI' (Errcode: 28 "No space left on device")