1

I asked this question yesterday and I think it's pretty clear what I'm focusing on but it got downvoted.

Please can someone explain what's wrong with the question and how I should improve it so I should know what and how to ask such questions in future?

I asked it before in stackoverflow and got a score of -3 until someone commented that this question belongs on this site so I deleted that question and posted it here but I'm now -1.

0
5

Downvotes (and upvotes, btw) are anonymous - not even moderators of the site can see who voted.

Non specific questions about query execution or performance, that don't include specific details about the query prompting the question, do tend to get down voted early since they are difficult to answer in a concise, practical way without conjecture around your local factors.

Votes should not be interpreted as commentary on your ability, they simply reflect what the community is seeing vis-a-vis the content of the question or answer they are voting on.

In your particular instance, it's provably incorrect to state that aggregates are faster than TOP, or that TOP is faster than an aggregate. It entirely depends on the semantics of the query, and the content and structure of the table, including what indexes are present. Also in play is the configuration of the specific server, including things like how much memory is assigned to the SQL Server instance, how many CPUs there are, the compatibility level of the database and various other settings.

If you add a concise minimal, complete, and verifiable example to your question, and narrow the question down to just that query, you'll probably see a difference in the acceptance level of your question.

3

You seem to recognise that it itsn't always true that "SELECT TOP is much faster than SELECT MIN()/MAX()", that sometimes it's the other way around, and you ask why.

Your question cannot be answered by theoretical reasoning, no matter how many Greek letters you use. It is entirely dependent on the physical design of your database objects -- tables, indexes, and whatever else may be involved in the execution of a particular query; on the characteristics of your data, such as data types, cardinalities, and value distributions; and on the specific implementation of the query optimizer by a particular database engine.

Since it cannot be properly answered, it should either be significantly revised or entirely removed.

You must log in to answer this question.

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