Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is primarily a temporary file that slows down your query. The word <code>temporary</code> in <code>EXPLAIN</code> means that every time you run this query MySQL server has to create a temporary table. While it's small, it is held in memory and thus is relatively fast. When it becomes large enough, it is moved to the disk and makes the query run really slow.</p> <p>When is temporary table used? It is well described in the <a href="http://dev.mysql.com/doc/refman/5.0/en/internal-temporary-tables.html" rel="nofollow">MySQL Reference Manual &ndash; Optimizing Database Structure</a>. In your case, it must be happening because you're ordering by field <code>timestamp</code> which is not included into the <code>GROUP BY</code> clause.</p> <p>Next, do you really need to group by all of these fields? Since you're grouping by primary key of <code>events</code> table, grouping by another <code>event</code>'s fields would have no sense. Try executing this query:</p> <pre><code>$scheduler-&gt;render_table("events LEFT JOIN tblfollowers ON events.id_user = tblfollowers.username WHERE events.status = 'active' AND tblfollowers.follower_id = '$test' OR events.id_user = '$test' GROUP BY events.event_id, events.timestamp ORDER BY events.timestamp DESC" , "event_id", "start_date, start_date, event_name, details"); </code></pre> <p><strong>EDIT:</strong> By the way, didn't you forget to put the parentheses around the condition? <code>AND</code> takes precedence over <code>OR</code>.</p> <pre><code>WHERE events.status ='active' AND (tblfollowers.follower_id='$test' OR events.id_user='$test') </code></pre> <p>That way it seems more logical to me. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    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.
    1. VO
      singulars
      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