|
![]() |
#1 |
Участник
|
Цитата:
А в лог заносится запись именно об удалении строки из SALESTABLE_TELECOMPHONTRA40478?
Чему равны поля LOGTYPE и TABLE_? В 2009 в лог пишется после каждой отработки delete_from (один раз на один удаляемый блок). LogType = Delete, Table - 40478 (ид. SALESTABLE_TELECOMPHONTRA40478) Так что запись в лог не тормозит, тормозит сам delete_from. X++: SALESTABLE_TELECOMPHONTRA40478 table; int64 firstRecid, lastRecid; int count2Del = 100000; ; select count(recid) from table where table.Month == _month; if(table.RecId > count2Del) { while (true) { if((select firstOnly TELECOMPHONTRA40478 where TELECOMPHONTRA40478.month == _month).recid != 0) { select minof(recid) from table where table.Month == _month; firstRecid = table.RecId; lastRecid = firstRecid + count2Del; select maxof(recid) from table where table.month == _month; if(table.RecId < lastRecid) lastRecid = table.RecId; table.skipDatabaseLog(true); table.skipDeleteActions(true); table.skipDeleteMethod(true); delete_from table where table.Month == _month && table.RecId >= firstRecid && table.RecId <= lastRecid; } else break; } } else { table.skipDatabaseLog(true); table.skipDeleteActions(true); table.skipDeleteMethod(true); delete_from table where table.Month == _month; } |
|
![]() |
#2 |
Участник
|
А сколько времени удаляются из AX 600000 записей (не по частям) ?
X++: table.skipDatabaseLog(true); delete_from table where table.Month == _month;
__________________
Sergey Nefedov |
|
![]() |
#3 |
Участник
|
|
|
Теги |
ax2009, ccadoconnection, delete_from, оптимизация, удаление |
|
|