Query time 0.00138
    
    
            JSON explain
        {
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "20.71"
    },
    "ordering_operation": {
      "using_filesort": true,
      "grouping_operation": {
        "using_temporary_table": true,
        "using_filesort": false,
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "range",
              "possible_keys": [
                "PRIMARY",
                "c_status",
                "p_category_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "category_id"
              ],
              "key_length": "3",
              "rows_examined_per_scan": 8,
              "rows_produced_per_join": 0,
              "filtered": "4.00",
              "index_condition": "(`atulecarter_atul_demo4`.`cscart_categories`.`category_id` in (175,176,185,186,187,188,189,202))",
              "cost_info": {
                "read_cost": "19.15",
                "eval_cost": "0.06",
                "prefix_cost": "19.21",
                "data_read_per_join": "855"
              },
              "used_columns": [
                "category_id",
                "storefront_id",
                "usergroup_ids",
                "status"
              ],
              "attached_condition": "(((`atulecarter_atul_demo4`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`atulecarter_atul_demo4`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`atulecarter_atul_demo4`.`cscart_categories`.`usergroup_ids`)) and (`atulecarter_atul_demo4`.`cscart_categories`.`status` in ('A','H')) and (`atulecarter_atul_demo4`.`cscart_categories`.`storefront_id` in (0,1)))"
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": [
                "PRIMARY",
                "pt"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "category_id"
              ],
              "key_length": "3",
              "ref": [
                "atulecarter_atul_demo4.cscart_categories.category_id"
              ],
              "rows_examined_per_scan": 2,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "0.33",
                "eval_cost": "0.13",
                "prefix_cost": "19.67",
                "data_read_per_join": "10"
              },
              "used_columns": [
                "product_id",
                "category_id"
              ]
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "status",
                "idx_parent_product_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "atulecarter_atul_demo4.products_categories.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "16.87",
              "cost_info": {
                "read_cost": "0.64",
                "eval_cost": "0.02",
                "prefix_cost": "20.44",
                "data_read_per_join": "529"
              },
              "used_columns": [
                "product_id",
                "product_type",
                "status",
                "company_id",
                "usergroup_ids",
                "parent_product_id"
              ],
              "attached_condition": "((`atulecarter_atul_demo4`.`products`.`parent_product_id` = 0) and ((`atulecarter_atul_demo4`.`products`.`usergroup_ids` = '') or find_in_set(0,`atulecarter_atul_demo4`.`products`.`usergroup_ids`) or find_in_set(1,`atulecarter_atul_demo4`.`products`.`usergroup_ids`)) and (`atulecarter_atul_demo4`.`products`.`status` = 'A') and (`atulecarter_atul_demo4`.`products`.`company_id` in ('1','2')) and (`atulecarter_atul_demo4`.`products`.`product_type` <> 'D'))"
            }
          },
          {
            "table": {
              "table_name": "companies",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "company_id"
              ],
              "key_length": "4",
              "ref": [
                "atulecarter_atul_demo4.products.company_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "50.00",
              "cost_info": {
                "read_cost": "0.11",
                "eval_cost": "0.01",
                "prefix_cost": "20.57",
                "data_read_per_join": "493"
              },
              "used_columns": [
                "company_id",
                "status",
                "company"
              ],
              "attached_condition": "(`atulecarter_atul_demo4`.`companies`.`status` = 'A')"
            }
          },
          {
            "table": {
              "table_name": "descr1",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "product_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id",
                "lang_code"
              ],
              "key_length": "9",
              "ref": [
                "atulecarter_atul_demo4.products_categories.product_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.05",
                "eval_cost": "0.01",
                "prefix_cost": "20.63",
                "data_read_per_join": "252"
              },
              "used_columns": [
                "product_id",
                "lang_code",
                "product"
              ]
            }
          },
          {
            "table": {
              "table_name": "prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "key": "usergroup",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "atulecarter_atul_demo4.products_categories.product_id"
              ],
              "rows_examined_per_scan": 2,
              "rows_produced_per_join": 0,
              "filtered": "96.52",
              "using_index": true,
              "cost_info": {
                "read_cost": "0.06",
                "eval_cost": "0.02",
                "prefix_cost": "20.71",
                "data_read_per_join": "2"
              },
              "used_columns": [
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "attached_condition": "((`atulecarter_atul_demo4`.`prices`.`lower_limit` = 1) and (`atulecarter_atul_demo4`.`prices`.`usergroup_id` in (0,0,1)))"
            }
          }
        ]
      }
    }
  }
}
    
            
            
                Result
                                    
                                                    | product_id | product | company_name | product_type | parent_product_id | 
                                            
                                                            | 59 | AVH-P4400BH | CS-Cart | P | 0 | 
                                            
                                                            | 58 | AVH-P8400BH | CS-Cart | P | 0 | 
                                            
                                                            | 60 | AVIC-Z130BT | CS-Cart | P | 0 | 
                                            
                                                            | 42 | DEH-1300MP | CS-Cart | P | 0 | 
                                            
                                                            | 39 | DEH-80PRS | CS-Cart | P | 0 | 
                                            
                                                            | 40 | DEH-P8400BH | CS-Cart | P | 0 | 
                                            
                                                            | 37 | DPX308U | CS-Cart | P | 0 | 
                                            
                                                            | 43 | FH-P8000BT | CS-Cart | P | 0 | 
                                            
                                                            | 56 | GM-6500F | CS-Cart | P | 0 | 
                                            
                                                            | 57 | GM-D8500M | CS-Cart | P | 0 | 
                                            
                                                            | 30 | GO 2535 TM WTE | CS-Cart | P | 0 | 
                                            
                                                            | 53 | KFC-W3012 | CS-Cart | P | 0 | 
                                            
                                                            | 52 | KFC-W3013PS | CS-Cart | P | 0 | 
                                            
                                                            | 33 | nüvi® 2455LT | CS-Cart | P | 0 | 
                                            
                                                            | 32 | nüvi® 3450 | CS-Cart | P | 0 | 
                                            
                                                            | 55 | PRS-D800 | CS-Cart | P | 0 | 
                                            
                                                            | 29 | TomTom GO LIVE Top Gear edition | CS-Cart | P | 0 | 
                                            
                                                            | 50 | TS-D1720C | CS-Cart | P | 0 | 
                                            
                                                            | 51 | TS-D6902R | CS-Cart | P | 0 | 
                                            
                                                            | 49 | TS-MR1640 | CS-Cart | P | 0 | 
                                            
                                                            | 48 | TS-MR2040 | CS-Cart | P | 0 | 
                                            
                                                            | 54 | TS-W3002D2|D4 | CS-Cart | P | 0 | 
                                            
                                                            | 65 | XRS 9370 | CS-Cart | P | 0 | 
                                            
                                                            | 64 | XRS 9745 | CS-Cart | P | 0 |