Query time 0.00058
    
    
            JSON explain
        {
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "11.07"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "1.83"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_promotions",
            "access_type": "ALL",
            "rows_examined_per_scan": 9,
            "rows_produced_per_join": 1,
            "filtered": "11.11",
            "cost_info": {
              "read_cost": "4.61",
              "eval_cost": "0.20",
              "prefix_cost": "4.81",
              "data_read_per_join": "80"
            },
            "used_columns": [
              "promotion_id",
              "company_id",
              "conditions",
              "bonuses",
              "to_date",
              "from_date",
              "priority",
              "stop",
              "stop_other_rules",
              "zone",
              "conditions_hash",
              "status",
              "number_of_usages",
              "users_conditions_hash"
            ],
            "attached_condition": "(if(`atulecarter_atul_demo5`.`cscart_promotions`.`from_date`,(`atulecarter_atul_demo5`.`cscart_promotions`.`from_date` <= 1761542650),1) and if(`atulecarter_atul_demo5`.`cscart_promotions`.`to_date`,(`atulecarter_atul_demo5`.`cscart_promotions`.`to_date` >= 1761542650),1) and (`atulecarter_atul_demo5`.`cscart_promotions`.`status` in ('A','H')) and (`atulecarter_atul_demo5`.`cscart_promotions`.`zone` = 'catalog'))"
          }
        },
        {
          "table": {
            "table_name": "cscart_promotion_descriptions",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "promotion_id",
              "lang_code"
            ],
            "key_length": "9",
            "ref": [
              "atulecarter_atul_demo5.cscart_promotions.promotion_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.00",
              "eval_cost": "0.20",
              "prefix_cost": "6.01",
              "data_read_per_join": "800"
            },
            "used_columns": [
              "promotion_id",
              "name",
              "short_description",
              "detailed_description",
              "lang_code"
            ]
          }
        },
        {
          "table": {
            "table_name": "storefronts_promotions",
            "access_type": "index",
            "key": "PRIMARY",
            "used_key_parts": [
              "storefront_id",
              "promotion_id"
            ],
            "key_length": "8",
            "rows_examined_per_scan": 6,
            "rows_produced_per_join": 1,
            "filtered": "30.56",
            "using_index": true,
            "using_join_buffer": "Block Nested Loop",
            "cost_info": {
              "read_cost": "2.86",
              "eval_cost": "0.37",
              "prefix_cost": "9.24",
              "data_read_per_join": "29"
            },
            "used_columns": [
              "storefront_id",
              "promotion_id"
            ],
            "attached_condition": "(<if>(found_match(storefronts_promotions), ((`atulecarter_atul_demo5`.`storefronts_promotions`.`storefront_id` = 1) or isnull(`atulecarter_atul_demo5`.`storefronts_promotions`.`storefront_id`)), true) and <if>(is_not_null_compl(storefronts_promotions), (`atulecarter_atul_demo5`.`storefronts_promotions`.`promotion_id` = `atulecarter_atul_demo5`.`cscart_promotions`.`promotion_id`), true))"
          }
        }
      ]
    }
  }
}