I assume your hardware is the same on both servers.
You can have a look with the profiler where the difference comes from.
SET profiling = 1;
SELECT /*yourquery...*/
SHOW PROFILES;
/*lookup the id for your query*/
SHOW PROFILE FOR QUERY 1 /*or whatever id your query has*/
You'll get a detailed list, what took how long and so on...
Also there's EXPLAIN EXTENDED
, with which you can see the optimized query.
An example is here in the manual.
Apart from that, it may well be, that the difference comes from different MySQL versions.
Percona did investigate performance improvements from 5.1 to 5.5. Result is here.