Simple query returning < 10000 rows taking 3-4 seconds

by Ben Slinger   Last Updated June 13, 2019 01:06 AM

I'm having some trouble diagnosing this very simple query which seems quite slow to me, any help would be much appreciated.

Entry in slow query log:

# Time: 190613 0:00:02
# Query_time: 3.903592 Lock_time: 0.000017 Rows_sent: 1405 Rows_examined: 1405
SET timestamp=1560384002;
select `guid` from `Episode` where `podcast_id` = 35011;

EXPLAIN for this query:

id  select_type table   type    possible_keys   key key_len ref rows    Extra
1   SIMPLE  Episode ref Episode_podcast_id  Episode_podcast_id  4   const   1405    

The table has around 40 million records. Is this just the time it's taking to retrieve 1405 values from this table? If so, how can I determine what the bottleneck is?



Related Questions


Updated February 19, 2016 02:02 AM

Updated July 28, 2015 14:02 PM

Updated July 22, 2015 13:02 PM

Updated July 22, 2015 18:02 PM

Updated September 22, 2018 17:06 PM