Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which is Faster
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Divers
Thread ID:
01219224
Message ID:
01219293
Vues:
10
>My companytable got over 35 fields (include 4 address field nvarchar(50)X 4, contact person.. etc)
>Now I need to insert to company code and company name into a temp table.
>
>(1) insert into myTemp(...) select .... from companytable
>OR
>(2) I create a view first which only select 10 fields from companytable
>insert into myTemp(....) select .. from myView
>
>Which is faster ?
>Thanks

Internally on the server my guess is that (1) might be slightly faster as SQL Server doesn't seem to optimize views well. The speed difference is probably very small unless you have a lot of records or you are putting some nonoptimized conditions in the query.
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform