Marlon Moyer wrote: > I am fed up with SQL Server! We've got a claims search section on our > internal website and the search allows you to filter on 30 different > columns. Currently, I'm trying to track down a condition where a > query is fed 4 filter columns, so 4 (blah = blah) in the where clause. > Currently the query runs 10 minutes, but if you change one of the > fields from (reserves > 0) to (reserves = 0), it runs in under 30 > seconds.
And let me take a wild guess: the number of rows that has (reserves > 0) is higher then the number of rows that has (reserves = 0) so the query is switching from an index scan to a table scan. Jochem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Purchase Studio MX with Flash Pro from House of Fusion, a Macromedia Authorized Affiliate and support the CF community. http://www.houseoffusion.com/banners/view.cfm?bannerid=51 Message: http://www.houseoffusion.com/lists.cfm/link=i:5:162512 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
