Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Correlated subquery
Message
De
17/03/2021 14:29:07
 
 
À
17/03/2021 13:25:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01679045
Message ID:
01679053
Vues:
63
>Yes in trial runs, with the files table only having 50,000 or so records, it seems to make no appreciable difference on speed. Just gotta get used to using it (like anything).
>

Like I said, it takes some time, but offers much more than IN

One thing...if you're using SQL Server as your back end, and you're using correlated subqueries on a LARGE table, you might want to check the actual execution plan. MANY moons ago (like 20 years!), SQL Server wasn't always smart about optimizing a correlated subquery and you "could" get a really horrible plan. By SQL 2005 I believe they cleaned up most or all of that.

(Ironically, when they implemented LINQ to SQL by around 2007....one of the worst ideas of all time...they generated some really god-awful correlated subqueries, At that time, they pretty much HAD to make sure that correlated subqueries worked efficiently.

There are still a few DBAs out there who are superstitiously frightened by correlated subqueries, because OLD versions of SQL would generate bad plans.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform