P
P
polupanov_ai2017-09-23 13:18:57
1C-Bitrix
polupanov_ai, 2017-09-23 13:18:57

Sorting getList bitrix. Is it worth using a filter?

If there are several thousand records in the infoblock, which CIBlock::getList query will work faster, using arFilter or selecting all records?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Nikolaev, 2017-09-25
@gromdron

If there are several thousand records in the infoblock, which CIBlock::getList query will work faster, using arFilter or selecting all records?

If we take the original statement of the request: for CIBlock::getList it doesn't matter how many records are in the infoblock itself, because you select not the elements, but the infoblocks themselves.
If we are talking about CIblockElement::getList(), then the request is not correct.
1) First you need to understand what you are doing with the records. The request time will not change much, but the result processing time can "walk" significantly.
That is, if you are displaying 1 thousand values ​​and 1 million values, time will be of the essence.
2) Then you need to understand whether you are using a complex filter or a simple one.
For example, in the infoblock you have 1 thousand entries. Tell me, will it be easier to get everything? Or get everything that has this parameter such, such or such, but this parameter is such and such, but only if the date is in the range from such and such to such and such and today is Thursday.
With small volumes, selecting all elements will be faster than using a filter by element, especially if there are AND / OR logical operators, while with LIKE, and even multiple properties by infoblock 1.0

I
IJIL, 2017-09-23
@IJIL

Turn on debugging on the panel and you will see what works faster

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question