This is a prepared and parameterized bit of code that I can't alter, however I can potentially add indexing if it would help.
Code comes from a front end web gui. It recently started taking 2-3 minutes for clients to load this 'view' in their browsers.
Table is 1.6 billion rows and the query only has one filter so clients can view all actions taken on a particular document.
Any ideas are appreciated.
Dan and Ed,
Tried using the where filter as a join predicate instead and no change.
By sqldriver 31 asked Oct 03, 2014 at 03:26 PM
This was mostly remedied with an index on artifact id and on the date column descending. There's a new missing index request, however three of the columns are large text, and this is a very active table. Inserts slowed down by 3-4x when I either modified the new index to accommodate all of the includes, or when I added the newly requested index.
Anyway, attached is the actual, run in SQL Sentry, with the trace flag as you requested. If you see anything else that might be improved, please let me know.
By sqldriver 31 answered Oct 04, 2014 at 03:01 AM