Parameterized v. hard codes renders different query plan

  • I was actually suggesting that the DTA might have created some indexes you do not need. You need to be very careful about the recommendations it makes and ensure you have tested it against the workload for an entire business cycle, not just a single query or a small read workload.

    Back to the two plans. The *ENTIRE BATCH* is evaluated character by character. It doesn't matter if the differences are in the SELECT list, the WHERE clause, or anywhere in between.

  • The only recommendation was to create one index. It had me create a covered index, given what we were trying to accomplish, it made sense. I probably wouldn't have created the index in production since the query was an ad-hoc for updating some data. Putting the index hint was sufficient. I really didn't see much of a change in performance using the newly created query v. forcing an index usage via an index hint.

    Good to know about how SQL Server reads a query. I've definitely got to do some reading in understanding internals.

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply