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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 25.11.2013, 14:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,477 / 846 (79) +++++++
Регистрация: 28.10.2006
emeadaxsupport: Slow performance when Configuration key turned off
Источник: http://blogs.msdn.com/b/axsupport/ar...urned-off.aspx
==============



Description:

The configuration key Sales tax (ledgerbasicSalesTax) has been turned off in the system. When running example the retail statement posting, the performance is very poor.

The slow response is originated in every call to TaxParameters::find().

When analyzing the sql server queries we see a large number of Temporary table been generated which all take 150-200 msec.







Reason:

By design:



We have explained what is happening in this article.



http://msdn.microsoft.com/en-us/library/bb314749.aspx



TempDB Tables for
Disabled Tables


You can disable a regular
persisted database table by disabling the configuration key
that controls the table. Disabling the key causes the system to automatically
create a TempDB style of temporary table that matches the fields and schema of
the database table. This temporary table exists in the underlying SQL Server
database and is managed by the Application Object Server (AOS).

The purpose of automatically
creating this TempDB table is to enable AOT objects that reference the disabled
table to continue to compile and run. You can read and write to this TempDB
table even though the configuration key is disabled.

All table buffer variables
inherit the methods of the xRecord class. One such
method is setTmp, which creates an InMemory temporary
table that has the same schema as the regular table. However, the setTmp method cannot create an InMemory table from a TempDB
table. You can call the method isTempDb to determine
whether the setTmp method is available.





Solution:

Turn it on again.

In the example with sales tax use a tax percentage of 0,00% instead







Author: Kim Truelsen

Date: 25/11-2013




Источник: http://blogs.msdn.com/b/axsupport/ar...urned-off.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Старый 25.11.2013, 14:25   #2  
trud is offline
trud
Участник
Лучший по профессии 2017
 
1,038 / 1629 (57) ++++++++
Регистрация: 07.06.2003
Записей в блоге: 1
Кстати прикольная тема
т.е. по сути советуют не отключать ключи на которых могут быть завязаны какие-нибудь таблицы.
а поскольку сложно понять что завязано, а что нет, то надо иметь все ключи включенными
у кого-нибудь есть идеи как с этим бороться?
Старый 25.11.2013, 14:40   #3  
lvan is offline
lvan
Участник
Аватар для lvan
Лучший по профессии 2014
 
856 / 82 (4) ++++
Регистрация: 15.04.2011
Записей в блоге: 1
бороться с чем? вроде в статье есть Solution простой
Старый 25.11.2013, 14:43   #4  
trud is offline
trud
Участник
Лучший по профессии 2017
 
1,038 / 1629 (57) ++++++++
Регистрация: 07.06.2003
Записей в блоге: 1
ну описанное solution - если вы отключили ключ, включите его.
причем приведен один пример, но такое же и будет с какими-нибудь RetailParameters, smmParameters и так далее
т.е. все это тоже придется включать
Старый 25.11.2013, 15:16   #5  
gl00mie is offline
gl00mie
Участник
MCBMSS
Most Valuable Professional
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3,684 / 5788 (200) ++++++++++
Регистрация: 28.11.2005
Адрес: Москва
Записей в блоге: 3
Насколько я понимаю, проблема в том, что раньше было два типа таблиц - постоянные и временные (Regular и InMemory в терминологии AX 2012), и в куче мест проверка !buf.IsTmp() означала по сути проверку на то, является ли таблица постоянной. Потом добавили новый тип таблиц - TempDB, а кучу кода, который знал лишь про два прежних типа таблиц, не поменяли, вот этот код и сломался, поскольку теперь !buf.isTmp() не тождественно проверке на то, что "актуальный" тип таблицы - Regular.
Лежащий на поверхности способ подправить ситуацию - это приделать костылик в метод Company::createParameter(), который бы перед попыткой вставить запись проверял, какой у таблицы тип в AOT (Regular/InMemory/TempDB) и какой "актуальный" тип (isTmp(), isTempDB()), и пытался создать запись лишь в том случае, если таблица и задумана, и по факту является постоянной. Ну и, возможно, кэшировать результата этой проверки...
За это сообщение автора поблагодарили: trud (1).
Старый 25.11.2013, 15:45   #6  
trud is offline
trud
Участник
Лучший по профессии 2017
 
1,038 / 1629 (57) ++++++++
Регистрация: 07.06.2003
Записей в блоге: 1
ну костылик поможет только частично
вот например код из smmParametersTable. при реализации костылика все равно будет выполняться
X++:
select firstonly parametersTable index key where parametersTable.Key == 1;
а при работе в CIL этот незамысловатый код даст довольно большую задержку.
вообще непонятна идея переводить отключенные таблицы на tempdb, чем просто временные не устраивали

X++:
public server static smmParametersTable find(boolean _forupdate = false)
{
    smmParametersTable parametersTable = null;
    ;

    if (parametersTable.isTmp())
    {
        return parametersTable;
    }

    parametersTable.selectForUpdate(_forupdate);

    // Find paramters table
    select firstonly parametersTable index key where parametersTable.Key == 1;

    // If paramters table is not found it is created
    if (!parametersTable && !parametersTable.isTmp())
    {
        // Use the generic framework for creating the parameters table
        Company::createParameter(parametersTable);
        //NumberSeqReference::construct(smmParametersTable::numberSeqModule()).load();
    }

    return parametersTable;
}
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
ax-erp: Choosing a Primary Key: Natural or Surrogate? Blog bot DAX Blogs 0 18.12.2012 02:11
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
emeadaxsupport: List of fixes that improve performance of certain features in Dynamics AX 2009 Blog bot DAX Blogs 0 13.10.2009 19:06
Inside Dynamics AX 4.0: Licensing and Configuration Blog bot DAX Blogs 0 31.10.2007 11:40
при построении перекрёстных ссылок выдаётся сообщение об ошибках mmmax DAX: Программирование 10 21.01.2005 12:42

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

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

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