Formatting a Wrapped Execution Plan

If you received or produced an execution plan like the following unreadable one: ---------------------------------------------------------------------------------------------------| Id  | Operation                   | Name                    | E-Rows |  OMem |1Mem | Used-Mem |---------------------------------------------------------------------------------------------------|   0 | SELECT STATEMENT            |                         |        |       ||          ||   1 |  SORT AGGREGATE             |                         |      1 |       ||          ||*  2 |   HASH JOIN                 |                         |     13 |  1102K|1102K|  … Continue reading Formatting a Wrapped Execution Plan

Why Query is not using the Index?

This post answers the following specific question:                 Why “distinct query” is not using the index (in some cases)? Let us try the following test case: Create sample table “t_distinct” and add an index to the “ID” column and collect statistics for table and index: Let us run the following basic query: It is clear … Continue reading Why Query is not using the Index?