Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index was not longer optimized
Message
 
 
À
06/04/2010 13:56:12
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01458951
Message ID:
01458987
Vues:
37
>>Your order by here is strange. I would probably re-write the whole query as
>>
>>select * from (select T.Numero, T.Title, T.Url, T.AddDate, row_number() 
>>over (partition by R.NoThread order by R.NoThread) as Row from Thread T LEFT JOIN Reply R on T.NoThread = R.NoThread) X 
>>where Row <=10
>
>I do not understand why it would be strange. The 10 records I need to select from Reply are subject to a specific order. To me, this is the clean way to do it.

I don't see an ORDER BY field in your example. ORDER BY 1 is no order - do you want them to be in the clustered index order?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform