-25

How do I make this MySQL query faster and better?

Although the question, in its original state, lacked some of the usual details expected for a SQL based question (CREATE TABLE, SHOW INDEX FROM, EXPLAIN, sample data, etc), it did in fact contain all the detail required to be able to assist the new contributor. Having the additional details, some of which have now been added by the OP, would not help with the problem as the issue is clearly visible in the structure of the OP's query.

The OP was not particularly responsive and replied with an image (of EXPLAIN output) instead of updating the question, but did then update the question appropriately when prompted. As irritating as this may be, I think it is not surprising for a new user. I wholeheartedly agree that the more effort that goes into asking a question the more effort you are likely to receive in return.

This question should not have been closed due to people not reading and/or understanding the question in front of them. A number (3) of, presumably well-meaning, people voted to close the question because they were unable to see the problem that was plainly visible.

This question still remains closed.

18
  • 3
    Would somebody please explain the down votes? I have searched on here and multiple posts suggest that posting a question on here tagged for support is the most appropriate course of action. Commented Dec 9, 2021 at 10:17
  • 5
    Downvotes can be cast to express the opinion that the question is either poorly researched, unclear, or simply not useful.
    – yivi
    Commented Dec 9, 2021 at 10:20
  • 4
    Lack of research: you haven't shown that there's a difference between now and then.
    – Braiam
    Commented Dec 9, 2021 at 10:20
  • 16
    I don't think that "New contributor" has to do anything with the closing. Unless you show some proof (e.g., numbers from the data explorer) that a systematical issue exists, the claim seems to be unfunded. About the specific question: I disagree that the initial version of the question contained all the information necessary. At least the keys are necessary, otherwise you're just guessing what the problem might be. For the records: Two of the three close voters have a gold badge in SQL, so I expect that the understand the question very well.
    – BDL
    Commented Dec 9, 2021 at 10:24
  • @yivi I still don't understand. I was trying to make the point, perhaps badly, that the OP's original question had all the detail required (the query) to see the problem. There is a simple problem with its structure. Commented Dec 9, 2021 at 10:38
  • 1
    @Braiam Surely the history of the question shows that the OP has added most, not all, of the additional details requested. Commented Dec 9, 2021 at 10:38
  • @BDL I think "New contributor" has everything to do with it, as new users often need prompting. I agree that this is not helpful but it is not good reason to close their questions when the original question has enough detail. I disagree with you about the need for the keys, although they are very useful especially with the cardinality output from SHOW INDEX, as the problem is clearly due to the sequence of LEFT JOINs. Commented Dec 9, 2021 at 10:38
  • 9
    @nnichols You are saying that there is a pattern of overzealousness when moderating questions by new users. You provide an example that does not necessarily prove your point. Some users may find the question either unclear or not useful, or that it lacks the appropriate evidence of research. Haven't voted myself, but that's what the downvote tooltip says.
    – yivi
    Commented Dec 9, 2021 at 10:41
  • 2
    When you say that the original question has enough details for you to answer - does it also mean there is enough details for somebody else to benefit from your answer? Or is it only useful for OP?
    – VLAZ
    Commented Dec 9, 2021 at 10:41
  • @yivi Thank you. I see your point. Commented Dec 9, 2021 at 10:43
  • @VLAZ I believe it would be useful to the OP and anyone who decided to view the question and answers, as an explanation of the problem with the OP's approach might help improve understanding. Commented Dec 9, 2021 at 10:44
  • 2
    Right but we don't tend to take answers, especially potential answers, into account to determine if a question is clear. So if you say that future visitors need to have an answer in order to understand what the problem is, does that not indicate the question is unclear?
    – VLAZ
    Commented Dec 9, 2021 at 10:47
  • 2
    I have edited my question to remove the generalised whinge about increased closing and focus solely on this one example. Thank you for the feedback. Commented Dec 9, 2021 at 11:42
  • 1
    the user has provided enough information, but as my first comment there indicates, the problem can't be soveld only which combined keys, the hole design must be reconsidered and more than helpful tips, the user will not get out of it, so a reopenung is not needed. also you have to consider, that this thread was rewritten,. so the first close votes where corrrect.
    – nbk
    Commented Dec 9, 2021 at 12:21
  • 1
    The title is unclear. A particular first post or first posts in general? Commented Dec 9, 2021 at 13:47

1 Answer 1

6

When the question was created, it did not have a proper minimal reproducible example. And to be fair, it still has room for improvement at the time of writing.

When created, the question only had the query in question, without the applicable table declarations, and the explanation table was behind a link. There were certainly not enough details for the question to be answered.

Moreover, "How to make X faster and better?" is too broad as an objective for the question. It may seem clear what the inefficiency is to a subject matter expert once they look at the explain table, but it wouldn't hurt to further describe the problem in words and what the ideal outcome should be.

As such, there were reasons for the question to be downvoted and closed that do not directly relate to the author of the question. The assumption that moderation was overzealous for that reason is unfounded, like many other reports of the same kind.

That there may be a correlation between low quality questions and new contributors does not mean that the quality standards should be relaxed for those users. See: What really amounts to "be nice to new contributors"?

3
  • Thank you for the link. I still don't understand why everyone believes that the lack of standard supporting information was a good reason to close the question. I genuinely believe that all the additional information detracts from the question which was amply supported by the query. Furthermore, the explain output was not useful in this case. I concede that the inclusion of the table declarations highlighted other issues. I accept that I am clearly in the minority in my way of thinking about this and thank you for your answer. Commented Dec 9, 2021 at 14:35
  • @nnichols "I genuinely believe that all the additional information detracts from the question which was amply supported by the query". Now consider this: you may be wrong. That is possible, don't you agree? Generally it is not a great idea to as a question asker, the person stuck and in need of help, to dictate what is and isn't useful to the people you are asking for help. You're not here to put people to work.
    – Gimby
    Commented Dec 9, 2021 at 16:41
  • @Gimby of course, I may be wrong. I am not infallible and I don't profess to be an expert. If the OP does not have customers who have made multiple purchases, then I am completely wrong and will be first to apologise for completely misunderstanding the situation. But assuming there are at least some customers who have placed many orders, the issue of the Cartesian product of those 5 sets is undeniable, and easily avoidable. I was not putting anyone to work and I find your final sentence offensive! Commented Dec 9, 2021 at 17:38

Not the answer you're looking for? Browse other questions tagged .