Archive for January, 2010

By fernando | January 26, 2010

how to prevent explain from executing subqueries

Here’s a quick tip for using explain: You may know this already, but mysql will actually execute some subqueries when you invoke explain.  Here’s an example: mysql> explain select id from projects where id = (select max(id) from projects where name like ‘en%’); +—-+————-+———-+——-+—————+———+———+——-+——-+————-+ | id | select_type | table | type | possible_keys | [...]