Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A database challenge
Message
De
28/02/2008 14:33:05
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
 
À
28/02/2008 07:17:13
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01295541
Message ID:
01297521
Vues:
23
When having multiple of suchs COALESCE constructs in one WHERE clause, is asking for performance problems on large tables.

Precisely- do SQL Server indexes "know" when a field contains a NULL value, and is the optimizer smart enough to winkle that out from inside a coalesce? Otherwise the supplied syntax will result in a full million-record table scan every time.

A carefully contructed dynamic SQL statement (with parameters) is outperforming such stored procedures, while the common wisdom is saying that stored procedures are faster.

On that we agree. ;-)

If you're not constructing a dynamic SQL statement (You can also do this within a stored procedure and call sp_executesql manually) without the unneccasary baggage, you'll end up with a statment that is inefficient in a number of aspects.

Useful thread, thanks. ;-)
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform