MySQL fetch time optimization

I faced slow fetch issue too (MySQL, InnoDB). Finally I found that innodb_buffer_pool_size is set to 8MB by default for my system which is not enough to handle the query. After increasing it to 1GB performance seems fine:

                    Duration / Fetch
353 row(s) returned 34.422 sec / 125.797 sec (8MB innodb buffer)
353 row(s) returned 0.500 sec / 1.297 sec (1GB innodb buffer)

UPDATE:

To change innodb_buffer_pool_size add this to your my.cnf

innodb_buffer_pool_size=1G

restart your mysql to make it effect

Reference: How to change value for innodb_buffer_pool_size in MySQL on Mac OS?