- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 10:29 AM
I'm wondering if the order of the filter conditions matters when running the filter.
Simple examples on the change request table, which one would run faster on average or would it be the same?
Filter 1:
Active = true
Approval = Approved Teamlead
State != Closed, Cancelled, Implemented - successful, Implemented - failed
Assignment_group.Type = ITIL and Applications
Risk != 5
Filter 2:
Approval = Approved Teamlead
State != Closed, Cancelled, Implemented - successful, Implemented - failed
Assignment_group.Type = ITIL and Applications
Risk != 5
Active = true
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 10:34 AM
My guess is that the app takes these conditions, converts them into a T-SQL query, queries the database, then returns the results. In that case, they do not matter, as the database will look at all the where clauses and query once, instead of querying all active, getting the result, then moving to query the approver out of that set of active, then moving to get all the states you want out of that result set of active and approver, etc.
Databases optimize queries. The thing that slows queries down is the lack of an index.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 10:34 AM
My guess is that the app takes these conditions, converts them into a T-SQL query, queries the database, then returns the results. In that case, they do not matter, as the database will look at all the where clauses and query once, instead of querying all active, getting the result, then moving to query the approver out of that set of active, then moving to get all the states you want out of that result set of active and approver, etc.
Databases optimize queries. The thing that slows queries down is the lack of an index.