Answer the question
In order to leave comments, you need to log in
Is it possible to optimize the deletion of infoblock elements?
There are 200 infoblocks in the project, 500 thousand elements.
The specified infoblock contains 80 properties, infoblocks 2.0
The element of this infoblock is deleted by the standard CIBlockElement::Delete
Deletion takes a minute, on an unloaded server.
Having debugged, I noticed that the longest operation in deletion is the deletion of property values.
There are 700 thousand records in the b_iblock_element_prop_m table.
The essence of deleting the select property by property ID (standard index in place), and then delete .
I understand that everything is described on the fingers, but nothing else, I will be glad for any advice on optimization.
Answer the question
In order to leave comments, you need to log in
write your own delete, with blackjack and courtesans,
if you look at the source in terms of deleting properties, then something strange happens there, select, update for some reason
bxapi.ru/src/?module_id=iblock&name=CIBlockElement...
in fact, these are just records in a bunch of different tables, judging by the source codes, not only the element is deleted, but also its variations, if the workflow is used,
well, with the
DELETE FROM handles and a bunch of such tables
, the only problem is that the events will not work, and files will remain in /upload
events can and nafig are not needed, since you need to delete a bunch of everything, but for good it would be good to delete the files before deleting the elements, if they exist and there are a lot of them
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question