Re: Problems when using TOP statement

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Henke (henke_nord_at_hotmail.com)
Date: 01/13/05


Date: Thu, 13 Jan 2005 17:07:03 +0100

When I added an ORDER BY clause the times became 2 seconds when using TOP 30
and 24 seconds when using TOP 20.

/Henke

"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> skrev i meddelandet
news:etTpxgY%23EHA.1084@tk2msftngp13.phx.gbl...
>> Maybe it is. But the problem is that when using TOP 30 it works fine
> (three
>> seconds) and with TOP 20 it doesn't (18 seconds).
>
> Could you please try adding an ORDER BY clause (e.g. to an indexed
> column).
> Since the query is useless and meaningless without the ORDER BY clause
> (e.g.
> no reason to keep it that way), I see little point in arguing about what
> happens here or troubleshooting it...
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>



Relevant Pages

  • Re: equijoin of two queries results in no result rows
    ... from the tblNames table and is specified in the GROUP BY statement. ... The GROUP BY clause in both of these was: ... the reverse. ... Both queries GROUP BY clauses were in the same order. ...
    (microsoft.public.access.queries)
  • Re: passing variables into an ORDER BY clause
    ... (Reverse address to reply.) ... "studen77" wrote in message ... One of these parameters I want to use in an ORDER BY clause within the query ...
    (microsoft.public.sqlserver.programming)
  • Re: SICPs exercise 4.68
    ... but the query system's algorithm isn't quite ... I think the problem comes in the clause ... includes the two lists and a third list whose only purpose is to be the same ... a REVERSE that works in both directions. ...
    (comp.lang.scheme)
  • Re: passing variables into an ORDER BY clause
    ... scalar values. ... (Reverse address to reply.) ... page only illustrate queries with a single ORDER BY clause and in trying ...
    (microsoft.public.sqlserver.programming)
  • Re: How to assign row number for each row in result of SELECT?
    ... (Reverse address to reply.) ... > I have SELECT with GROUP BY clause, also I added a calculated column named ... and it should reset for each rowset ...
    (microsoft.public.sqlserver.programming)