Note that there are some explanatory texts on larger screens.

plurals
  1. POMySql - slow sending data phase
    primarykey
    data
    text
    <p>One of my queries on MySQL 5.0.45 is running slow in "sending data" phase. The query is a simple select, returns about 300 integer ID fields as result set.</p> <pre> mysql> SELECT source_id FROM directions WHERE (destination_id = 10); +-----------+ | source_id | +-----------+ | 2 | | 8 | ... | 2563 | +-----------+ 341 rows in set (2.13 sec) </pre> <p>I am note sure why is "sending data" phase so slow and what can be done to make it fast. Please note I am executing this query on MySQL prompt on the server itself, so not really expecting it to spend so much time in "sending data". Any clues?</p> <p>If it helps, I have 3 text fields on this table, but since they are not being selected, I am expecting they are not cause of this slowness.</p> <p>This query runs thousands of times a day and can't really afford to spend 2 secs on it each time.</p> <p>Profiling result:</p> <pre> mysql> show profile for query 4; +--------------------------------+----------+ | Status | Duration | +--------------------------------+----------+ | (initialization) | 0.000003 | | checking query cache for query | 0.000051 | | checking permissions | 0.000007 | | Opening tables | 0.000011 | | System lock | 0.000005 | | Table lock | 0.000023 | | init | 0.00002 | | optimizing | 0.00001 | | statistics | 0.00006 | | preparing | 0.000014 | | executing | 0.000005 | | Sending data | 2.127019 | | end | 0.000015 | | query end | 0.000004 | | storing result in query cache | 0.000039 | | freeing items | 0.000011 | | closing tables | 0.000007 | | logging slow query | 0.000047 | +--------------------------------+----------+ 18 rows in set (0.00 sec) </pre> <p>UPDATE: I stumbled upon the following URL which says</p> <pre> Each time means the time elapsed between the previous event and the new event. So, the line: | Sending data | 0.00016800 | means that 0.00016800 seconds elapsed between "executing" and "Sending data". It is, it takes 0.00016800 seconds to execute the query. </pre> <p><a href="http://forums.mysql.com/read.php?24,241461,242012#msg-242012" rel="noreferrer">http://forums.mysql.com/read.php?24,241461,242012#msg-242012</a></p> <p>Can somebody validate?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload