AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.06.2014, 15:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
AX 2009 Technical Journal: AX 2009 SP1, Parameter Sniffing finally addressed by Microsoft
Источник: http://ax2009tech.blogspot.com/2014/...g-finally.html
==============

Most of you have probably struggeled with Parameter Sniffing issues in AX solutions and it finally seems like Microsoft has been able to address this design issue also for AX 2009 SP1! The fix introduced in AX 2012 R2 CU6 has been backported to AX 2012 R0/R1 and now also AX 2009 SP1.Please see AX 2012 R2 CU6, Feature to reduce the effect of Parameter Sniffing.

Please have a look at SQL Server Parameter Sniffing with Dynamics AX, just plain evil. (Redux 5-19-2014) and note that kernel builds after 5.0.1600.2553 (KB2934938) will include a fix that changes the way SQL statements are generated from the AOS by always sending the value for the column DATAAREAID as a literal instead of a parameter (the x-factor).

Also please note that the instructions for updating the value in the table SQLSYSTEMVARIABLES are wrong - the value for the column PARM in the row added to SQLSYSTEMVARIABLES as part of implementing this kernel build, is DATAAREALITERAL (NOT DATAAREAIDLITERAL).

The correct SQL Update Statement to enable literals for DATAAREAID is

UPDATE SQLSYSTEMVARIABLES SET VALUE = '1' WHERE PARM = 'DATAAREALITERAL'



It took me a couple of minutes to realize this when first enabling the DATAAREALITERAL in an AX 2009 SP1 solution for the first time, but a quick SELECT aginst SQLSYSTEMVARIABLES, returned a row containing the value DATAAREALITERAL.



This fix should be evaluated and implemented in every AX 2009 SP1 solution having one company contributing to most rows in shared tables to avoid "Plain Evil", frustration and ad hoc work.

Verification:

Actual value for DATAAREAID is replaced by 'xxx'.

SELECT SUM(A.QTY) FROM PROJINVOICEITEM A,PROJITEMTRANS B WHERE (A.DATAAREAID=N'xxx') AND((B.DATAAREAID=N'xxx') AND((B.PROJTRANSID=A.PROJTRANSID) AND(B.PROJTRANSIDREF=@P1)))



<div class="MsoNormal">SELECT<span lang="EN-GB" style="font-family: "Courier New"; font-size: 10.0pt; mso-ansi-language: EN-GB;"> A.AGREEMENT,A.ITEMCODE,A.ACCOUNTCODE,A.ITEMRELATION,A.ACCOUNTRELATION,A.QUANTITYAMOUNT,A.FROMDATE,A.TODATE,A.AMOUNT,A.CURRENCY,A.PERCENT1,A.PERCENT2,A.DELIVERYTIME,A.SEARCHAGAIN,A.PRICEUNIT,A.RELATION,A.UNITID,A.MARKUP,A.ALLOCATEMARKUP,A.MODULE,A.INVENTDIMID,A.CALENDARDAYS,A.CIT_AGREEMENT,A.RECVERSION,A.RECID FROM PRICEDISCTABLE A WHERE ((DATAAREAID=N'xxx') AND((((((((((RELATION=@P1) AND(ITEMCODE=@P2)) AND(ITEMRELATION=@P3)) AND(ACCOUNTCODE=@P4)) AND(ACCOUNTRELATION=@P5)) AND(UNITID=@P6)) AND(CURRENCY=@P7)) AND(INVENTDIMID=@P8)) AND((@P9>=FROMDATE) OR((FROMDATE=@P10)))) AND((@P11<span style="color: grey;">
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
За это сообщение автора поблагодарили: Logger (3).
Старый 04.11.2015, 10:11   #2  
Logger is offline
Logger
Участник
Лучший по профессии 2015
Лучший по профессии 2014
 
3,875 / 3123 (112) ++++++++++
Регистрация: 12.10.2004
Адрес: Москва
Записей в блоге: 2
Иногда бывают гадости в отчетах после хотфикса :
http://thebesthacker.com/question/ht...h-columns.html
Теги
aoc, dataarea, dbcc, dbcc freeproccache, dbcc showstatistics, hotfix, literal, placeholder, sql server, план запроса, производительность

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axforum blogs: Квест: Подружим Dynamics Ax 2009 Sp1 RU7 c SharePoint Foundation 2010 Blog bot DAX Blogs 4 16.10.2017 17:50
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 16 Blog bot Dynamics CRM: Blogs 0 23.01.2014 03:15
emeadaxsupport: Resolving some issues you may experience when creating an AX 2009 Role Center and Enterprise Portal Site using SharePoint Server/Foundation 2010 after installing Microsoft Dynamics AX 2009 SP1 hotfix 2278963 Blog bot DAX Blogs 1 24.09.2010 11:34
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
gatesasbait: Dynamics AX 2009 SSRS and SSAS Integration Tips Blog bot DAX Blogs 3 09.07.2009 13:07

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 12:47.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.