Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Would index tag speed up this SQL Select
Message
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Indexation
Titre:
Would index tag speed up this SQL Select
Versions des environnements
SQL Server:
SQL Server 2014
Application:
Web
Divers
Thread ID:
01621119
Message ID:
01621119
Vues:
64
Hi,

I have the following SQL Select that looks for the last order number:
select top 1 order_no from order_file where REC_ID <> 'D' order by order_no desc
The column ORDER_NO is the Primary key and Identity. But I noticed in SSMS that this column does not have an Index. Do I need to create an index for this column or the fact that it is Primary key already created an index?

Also, would creating an index on column REC_ID speed up the above SQL Select?

TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform