Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A database challenge
Message
From
28/02/2008 14:33:05
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
28/02/2008 07:17:13
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01295541
Message ID:
01297521
Views:
25
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform