var q = 'SELECT * FROM stories_comments WHERE story_id=? AND user_id=? ORDER BY created_at ASC';
mclient.query(q, [story_id, 0], function(err, results, fields){
next(err, results);
});
For example, this is my code. I want to explain this query in MySQL, but I don't have values to place story_id. How do I explain it with a dummy id? I want MySQL to give me an explain statement as if story_id was "9", let's say.
Basically, I just want MySQL to explain this query, even if I don't have story_id or user_id provided.
Without values, it can't explain query, because it can't estimate the number of rows it needs to scan. This is not only to show the rows in the explain output, but to choose proper index - if you have index on story_id and another one on user_id, it will choose the one that selects less rows. And sometimes explain can see that where clause do not match rows at all (and will output impossible where clause)