Posts

Showing posts with the label The memo

Inside the SQL Server Query Optimizer - part 6 What is the memo?

Image
Hi Guys, Where did we get to last time? Last time we had talked about the cost based optimization process and the transformation rules that applied by the optimizer were looking for a better performance plan. The memo So the question is: Where our alternative plans are stored? They are stored in a component called memo . You can find more info about this structure in the “ Cascades general optimization framework ” developed by Goetz Graefe. Today I would show you only how the memo work , nothing more! We should enable some trace flag in order to display the information we need. Through the trace flag 8608 we can show the initial Memo Structure, Through the trace flag 8615 we can show the final Memo Structure, To better explain the process we take as example our Query used in the previous posts. SELECT ANNDOC, NUMDOC, SUM (R.QTA1) AS SUM_QTA FROM ORDTES T JOIN ORDRIG R ON R.IDORDTES = T.ID WHERE ANNDOC = 2018 GROUP BY ANNDOC, NUMDOC ORDER BY...