Query is invalid
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "138747.45"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "C",
"access_type": "const",
"possible_keys": [
"PRIMARY",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.10",
"prefix_cost": "0.00",
"data_read_per_join": "10K"
},
"used_columns": [
"category_id",
"services"
]
}
},
{
"table": {
"table_name": "CD",
"access_type": "ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.25",
"eval_cost": "0.10",
"prefix_cost": "0.35",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"lang_code",
"category"
]
}
},
{
"table": {
"table_name": "PC",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"link_type",
"pt",
"idx_pc_product_id_type"
],
"key": "link_type",
"used_key_parts": [
"link_type",
"category_id"
],
"key_length": "6",
"ref": [
"const",
"const"
],
"rows_examined_per_scan": 64,
"rows_produced_per_join": 64,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.27",
"eval_cost": "6.40",
"prefix_cost": "7.02",
"data_read_per_join": "1024"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"table": {
"table_name": "P",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"age_verification",
"status",
"idx_parent_product_id",
"cscart_products_brand_id_index",
"cscart_products_conditions_index",
"cscart_products_real_company_id_index",
"cscart_products_product_id_index",
"idx_status"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"dev2.PC.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 46,
"filtered": "72.23",
"cost_info": {
"read_cost": "16.00",
"eval_cost": "4.62",
"prefix_cost": "29.42",
"data_read_per_join": "348K"
},
"used_columns": [
"product_id",
"product_code",
"status",
"company_id",
"amount",
"timestamp",
"updated_timestamp",
"sort_index",
"guarantee_id",
"conditions",
"year",
"city_place",
"city_id",
"brand_id",
"uniqueSale",
"is_confiscated",
"type_of_sale"
],
"attached_condition": "(`dev2`.`P`.`status` = 'A')"
}
},
{
"table": {
"table_name": "COM",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"company_id"
],
"key_length": "4",
"ref": [
"dev2.P.company_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "10.00",
"cost_info": {
"read_cost": "11.56",
"eval_cost": "0.46",
"prefix_cost": "45.60",
"data_read_per_join": "34K"
},
"used_columns": [
"company_id",
"status",
"company"
],
"attached_condition": "(`dev2`.`COM`.`status` = 'A')"
}
},
{
"table": {
"table_name": "PP",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id"
],
"key": "usergroup",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"dev2.PC.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.30",
"eval_cost": "0.46",
"prefix_cost": "47.36",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"price",
"currency",
"recycling_price_rub",
"discount_percent",
"lower_limit",
"usergroup_id"
]
}
},
{
"table": {
"table_name": "PD",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"product_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id",
"lang_code"
],
"key_length": "9",
"ref": [
"dev2.PC.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "3.85",
"eval_cost": "0.46",
"prefix_cost": "51.67",
"data_read_per_join": "21K"
},
"used_columns": [
"product_id",
"lang_code",
"product",
"short_description",
"full_description",
"leasingCount",
"leasingPrice"
]
}
},
{
"table": {
"table_name": "CUR",
"access_type": "eq_ref",
"possible_keys": [
"currency_code"
],
"key": "currency_code",
"used_key_parts": [
"currency_code"
],
"key_length": "12",
"ref": [
"dev2.PP.currency"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.16",
"eval_cost": "0.46",
"prefix_cost": "53.29",
"data_read_per_join": "443"
},
"used_columns": [
"currency_id",
"currency_code",
"price"
]
}
},
{
"table": {
"table_name": "B",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"brand_id"
],
"key_length": "4",
"ref": [
"dev2.P.brand_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.16",
"eval_cost": "0.46",
"prefix_cost": "54.91",
"data_read_per_join": "15K"
},
"used_columns": [
"brand_id",
"brand",
"has_subsidy"
]
}
},
{
"table": {
"table_name": "GW",
"access_type": "ALL",
"rows_examined_per_scan": 48,
"rows_produced_per_join": 221,
"filtered": "100.00",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "0.27",
"eval_cost": "22.19",
"prefix_cost": "77.36",
"data_read_per_join": "3K"
},
"used_columns": [
"wishlist_id",
"product_id",
"guest_id"
],
"attached_condition": "<if>(is_not_null_compl(GW), ((`dev2`.`GW`.`guest_id` = 0) and (`dev2`.`PC`.`product_id` = `dev2`.`GW`.`product_id`)), true)"
}
},
{
"table": {
"table_name": "GC",
"access_type": "ALL",
"rows_examined_per_scan": 88,
"rows_produced_per_join": 19525,
"filtered": "100.00",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "0.98",
"eval_cost": "1952.53",
"prefix_cost": "2030.87",
"data_read_per_join": "305K"
},
"used_columns": [
"compare_id",
"guest_id",
"product_id"
],
"attached_condition": "<if>(is_not_null_compl(GC), ((`dev2`.`GC`.`guest_id` = 0) and (`dev2`.`PC`.`product_id` = `dev2`.`GC`.`product_id`)), true)"
}
},
{
"table": {
"table_name": "PST",
"access_type": "ref",
"possible_keys": [
"cscart_product_stocks_pk"
],
"key": "cscart_product_stocks_pk",
"used_key_parts": [
"product_id"
],
"key_length": "4",
"ref": [
"dev2.PC.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 20086,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "8847.90",
"eval_cost": "2008.63",
"prefix_cost": "12887.39",
"data_read_per_join": "470K"
},
"used_columns": [
"product_id",
"stock_id"
],
"attached_condition": "<if>(is_not_null_compl(PST), (`dev2`.`PC`.`product_id` = `dev2`.`PST`.`product_id`), true)"
}
},
{
"table": {
"table_name": "CST",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"stock_id"
],
"key_length": "4",
"ref": [
"dev2.PST.stock_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 20086,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.19",
"eval_cost": "2008.63",
"prefix_cost": "14897.21",
"data_read_per_join": "7M"
},
"used_columns": [
"stock_id",
"fias_id"
]
}
},
{
"table": {
"table_name": "CITY",
"access_type": "ref",
"possible_keys": [
"idx_custom_city_fias_id"
],
"key": "idx_custom_city_fias_id",
"used_key_parts": [
"fias_id"
],
"key_length": "386",
"ref": [
"dev2.CST.fias_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 20086,
"filtered": "100.00",
"cost_info": {
"read_cost": "5021.57",
"eval_cost": "2008.63",
"prefix_cost": "21927.40",
"data_read_per_join": "104M"
},
"used_columns": [
"city_id",
"address",
"fias_id"
]
}
},
{
"table": {
"table_name": "HP",
"access_type": "ref",
"possible_keys": [
"idx_hp_product_id"
],
"key": "idx_hp_product_id",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"dev2.PC.product_id"
],
"rows_examined_per_scan": 2,
"rows_produced_per_join": 49736,
"filtered": "100.00",
"cost_info": {
"read_cost": "23873.55",
"eval_cost": "4973.66",
"prefix_cost": "50774.61",
"data_read_per_join": "11M"
},
"used_columns": [
"id",
"product_id",
"created_at"
]
}
},
{
"table": {
"table_name": "IMG",
"access_type": "ref",
"possible_keys": [
"product_id"
],
"key": "product_id",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"dev2.PC.product_id"
],
"rows_examined_per_scan": 3,
"rows_produced_per_join": 195469,
"filtered": "100.00",
"cost_info": {
"read_cost": "48867.50",
"eval_cost": "19547.00",
"prefix_cost": "119189.11",
"data_read_per_join": "5M"
},
"used_columns": [
"product_id",
"watermark_small_file_id",
"alt"
]
}
},
{
"table": {
"table_name": "FILE",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"id"
],
"key_length": "4",
"ref": [
"dev2.IMG.watermark_small_file_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 195469,
"filtered": "100.00",
"cost_info": {
"read_cost": "11.35",
"eval_cost": "19547.00",
"prefix_cost": "138747.45",
"data_read_per_join": "711M"
},
"used_columns": [
"id",
"path"
]
}
}
],
"select_list_subqueries": [
{
"dependent": true,
"cacheable": false,
"query_block": {
"select_id": 2,
"cost_info": {
"query_cost": "0.56"
},
"table": {
"table_name": "cscart_product_stocks",
"access_type": "ref",
"possible_keys": [
"cscart_product_stocks_pk"
],
"key": "cscart_product_stocks_pk",
"used_key_parts": [
"product_id"
],
"key_length": "4",
"ref": [
"func"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.45",
"eval_cost": "0.10",
"prefix_cost": "0.56",
"data_read_per_join": "24"
},
"used_columns": [
"product_id"
],
"attached_condition": "(`dev2`.`cscart_product_stocks`.`product_id` = `dev2`.`P`.`product_id`)"
}
}
}
]
}
}
}
}