в которой более 60000 записей, можно ли как то оптимизировать? Может получать порциями или как то еще
чтобы оптимизировать , надо видеть запрос.
EXPLAIN SELECT iblock_elements_element_fewfwe.ID, iblock_elements_element_fewfwe.CODE, iblock_elements_element_fewfwe.NAME, iblock_elements_element_fewfwe.IBLOCK_SECTION_ID, iblock_elements_element_fewfwe_iblock.DETAIL_PAGE_URL, iblock_elements_element_fewfwe_iblock.SECTION_PAGE_URL, iblock_elements_element_fewfwe_file.SUBDIR, iblock_elements_element_fewfwe_file.FILE_NAME, iblock_elements_element_fewfwe_product_price.PRICE AS FILTERED_PRODUCT_PRICE, iblock_elements_element_fewfwe_sale_price.PRICE AS PRODUCT_SALE_PRICE, iblock_elements_element_fewfwe_product_price.BONUS AS PRODUCT_BONUS, iblock_elements_element_fewfwe_catalog.AVAILABLE AS AVAILABLE, iblock_elements_element_fewfwe_product_price.CURRENCY AS CURRENCY, iblock_elements_element_fewfwe.IBLOCK_ID AS IBLOCK_ID, iblock_elements_element_fewfwe.DATE_CREATE AS DATE_CREATE, iblock_elements_element_fewfwe_status.XML_ID AS STATUS_VALUE, iblock_elements_element_fewfwe_brand.UF_NAME AS BRAND_NAME, iblock_elements_element_fewfwe.DETAIL_TEXT AS DETAIL_TEXT, iblock_elements_element_fewfwe.PREVIEW_TEXT AS PREVIEW_TEXT, iblock_elements_element_fewfwe_iblock_section.ID AS SECTION_ID, iblock_elements_element_fewfwe_iblock_section.NAME AS SECTION_NAME, iblock_elements_element_fewfwe_cml2_brands_ref.VALUE AS TEMP_BRAND_NAME, iblock_elements_element_fewfwe_cml2_status.VALUE_ENUM AS TEMP_STATUS, iblock_elements_element_fewfwe_rrc_price.PRICE AS PRODUCT_RRC_PRICE FROM b_iblock_element iblock_elements_element_fewfwe INNER JOIN b_catalog_product iblock_elements_element_fewfwe_catalog ON iblock_elements_element_fewfwe.ID = iblock_elements_element_fewfwe_catalog.ID INNER JOIN b_catalog_store_product iblock_elements_element_fewfwe_store ON iblock_elements_element_fewfwe.ID = iblock_elements_element_fewfwe_store.PRODUCT_ID INNER JOIN b_catalog_price iblock_elements_element_fewfwe_product_price ON iblock_elements_element_fewfwe_product_price.CATALOG_GROUP_ID = '5' AND iblock_elements_element_fewfwe.ID = iblock_elements_element_fewfwe_product_price.PRODUCT_ID LEFT JOIN b_catalog_price iblock_elements_element_fewfwe_sale_price ON iblock_elements_element_fewfwe.ID = iblock_elements_element_fewfwe_sale_price.PRODUCT_ID AND iblock_elements_element_fewfwe_sale_price.CATALOG_GROUP_ID = '9' LEFT JOIN b_file iblock_elements_element_fewfwe_file ON iblock_elements_element_fewfwe.DETAIL_PICTURE = iblock_elements_element_fewfwe_file.ID LEFT JOIN b_iblock_element_property iblock_elements_element_fewfwe_cml2_status ON iblock_elements_element_fewfwe.ID = iblock_elements_element_fewfwe_cml2_status.IBLOCK_ELEMENT_ID AND iblock_elements_element_fewfwe_cml2_status.IBLOCK_PROPERTY_ID = 42231 LEFT JOIN b_iblock_property_enum iblock_elements_element_fewfwe_status ON iblock_elements_element_fewfwe_cml2_status.VALUE_ENUM = iblock_elements_element_fewfwe_status.ID LEFT JOIN b_iblock_element_property iblock_elements_element_fewfwe_cml2_brands_ref ON iblock_elements_element_fewfwe.ID = iblock_elements_element_fewfwe_cml2_brands_ref.IBLOCK_ELEMENT_ID AND iblock_elements_element_fewfwe_cml2_brands_ref.IBLOCK_PROPERTY_ID = 3492 LEFT JOIN rz_bitronic2_brand_reference iblock_elements_element_fewfwe_brand ON iblock_elements_element_fewfwe_cml2_brands_ref.VALUE = iblock_elements_element_fewfwe_brand.UF_XML_ID LEFT JOIN b_catalog_price iblock_elements_element_fewfwe_rrc_price ON iblock_elements_element_fewfwe.ID = iblock_elements_element_fewfwe_rrc_price.PRODUCT_ID AND iblock_elements_element_fewfwe_rrc_price.CATALOG_GROUP_ID = '8' AND iblock_elements_element_fewfwe_brand.UF_NAME = 'Samsung' LEFT JOIN b_iblock iblock_elements_element_fewfwe_iblock ON iblock_elements_element_fewfwe.IBLOCK_ID = iblock_elements_element_fewfwe_iblock.ID LEFT JOIN b_iblock_section iblock_elements_element_fewfwe_iblock_section ON iblock_elements_element_fewfwe.IBLOCK_SECTION_ID = iblock_elements_element_fewfwe_iblock_section.ID WHERE iblock_elements_element_fewfwe.IBLOCK_ID = 59 ORDER BY ID ASC
😃
Слушай, в этом дерьме даже разбираться бессмысленно, индексы там все есть, запрос ты не переделаешь, оно генерируется, надо ставить SSD и много-много памяти, и это говно начинает летать.
В чём у тебя претензии к запросу и плану, всё по индексам, всё как надо.
Обсуждают сегодня