SELECT 
  pc.product_id 
FROM 
  cscart_products_categories AS pc 
WHERE 
  pc.category_id IN (
    SELECT 
      c.category_id 
    FROM 
      cscart_categories AS c 
      LEFT JOIN cscart_products AS p ON p.product_id = pc.product_id 
    WHERE 
      c.parent_id = 597 
      AND p.status = 'A'
  )

Query time 0.00678

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "785.38"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "c",
          "access_type": "ref",
          "possible_keys": [
            "PRIMARY",
            "parent",
            "p_category_id"
          ],
          "key": "parent",
          "used_key_parts": [
            "parent_id"
          ],
          "key_length": "3",
          "ref": [
            "const"
          ],
          "rows_examined_per_scan": 17,
          "rows_produced_per_join": 17,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "0.25",
            "eval_cost": "1.70",
            "prefix_cost": "1.95",
            "data_read_per_join": "185K"
          },
          "used_columns": [
            "category_id",
            "parent_id"
          ]
        }
      },
      {
        "table": {
          "table_name": "pc",
          "access_type": "ref",
          "possible_keys": [
            "PRIMARY",
            "pt",
            "idx_pc_product_id_type"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "category_id"
          ],
          "key_length": "3",
          "ref": [
            "dev2.c.category_id"
          ],
          "rows_examined_per_scan": 101,
          "rows_produced_per_join": 1728,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "5.65",
            "eval_cost": "172.84",
            "prefix_cost": "180.44",
            "data_read_per_join": "27K"
          },
          "used_columns": [
            "product_id",
            "category_id"
          ]
        }
      },
      {
        "table": {
          "table_name": "p",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY",
            "status",
            "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": 1248,
          "filtered": "72.23",
          "cost_info": {
            "read_cost": "432.10",
            "eval_cost": "124.84",
            "prefix_cost": "785.38",
            "data_read_per_join": "9M"
          },
          "used_columns": [
            "product_id",
            "status"
          ],
          "attached_condition": "(`dev2`.`p`.`status` = 'A')"
        }
      }
    ]
  }
}

Result

product_id
9231
16109
16162
16163
16167
16168
16444
16846
18308
19828
19836
22032
22323
25098
25484
25486
25607
25674
25704
25708
25740
25741
25747
25785
25824
25881
25882
25884
25888
25889
25895
25942
25943
25967
26000
26001
26118
26179
26183
26189
26191
26213
26222
26333
26346
26359
26360
26403
26426
26440
26443
26465
26523
26566
26567
26568
26591
26610
26613
26615
26616
26631
26650
26660
26661
26662
26674
26691
26693
26694
26707
26728
26803
26805
26806
26807
26824
26834
26850
26851
26853
26855
26892
26921
26922
26941
26942
26975
27001
27032
27035
27079
27081
27083
27087
27097
27115
27118
27119
27120
27126
27127
27128
27131
27134
27135
27136
27149
27152
27153
27154
27159
27226
27229
27236
27243
27244
27246
27249
27273
19845
19849
22286
22365
22454
24065
24431
25672
25748
25764
25765
25767
25768
25769
25770
25771
25772
25858
25883
25885
25941
25977
26117
26176
26243
26344
26381
26395
26405
26432
26446
26480
26524
26562
26606
26608
26614
26658
26663
26664
26665
26731
27030
27060
27082
27085
27100
27110
27132
27133
27139
27277
19470
14735
14675
14677
14784
14786
14790
16478
16598
16919
16929
19932
19949
19959
20019
20020
20086
20263
20266
20280
22214
22229
22376
22443
22482
22500
23454
25238
25243
25274
25609
25640
25644
25662
25755
25762
25766
25778
25787
25796
25801
25860
25957
25958
25975
25981
25991
26025
26152
26182
26224
26236
26276
26319
26383
26415
26506
26515
26517
26534
26537
26549
26550
26551
26573
26634
26721
26723
26734
26907
28496
28598
28676
32930
9262
14795
14810
19519
20018
24059
25281
25651
25931
26241
26252
26571
27281
27388
27398
27472
28167
28437
28684
28733
6070
6071
6072
6073
6074
6075
6076
6078
6079
6080
6082
8583
8971
14797
14805
14814
16093
16158
16159
16160
16441
16904
16925
16936
17266
18301
18303
19181
19517
19527
20013
20021
20094
21964
22109
22371
22589
25078
25493
25647
25648
25649
25653
25655
25656
25660
25661
25705
25706
25707
25710
25738
25763
25776
25794
25826
25871
25891
25892
25903
25936
25951
25953
25999
26052
26084
26085
26086
26087
26102
26103
26105
26107
26136
26154
26156
26157
26175
26192
26223
26301
26302
26303
26349
26354
26357
26365
26413
26416
26424
26454
26468
26470
26528
26532
26535
26539
26599
26623
26624
26625
26642
26643
26825
26937
27049
27276
27418
27420
28674
28931
6084
6085
6086
6087
6088
6089
6090
6091
6092
14788
16097
16448
16918
17180
17246
18274
18302
19183
19500
20026
22015
22311
22587
25018
25272
25709
25783
25935
25938
25952
26002
26055
26106
26162
26248
26250
26253
26299
26459
26576
26577
26578
26618
26619
26620
26644
26680
26738
26739
26740
26818
27075
27464
27538
28189
28682
32442
32520
33026
33028
33030
7897
7898
8135
16892
16893
18684
20089
20617
22055
22173
25489
25742
25754
25761
25887
25950
25956
25993
26026
26133
26155
26215
26230
26254
26278
26355
26356
26419
26531
26533
26647
26797
26798
26799
26859
26860
26863
26991
27422
27470
28678
28933
8134
8136
14663
14818
14823
28319
28323
28680
32538
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
14334
14536
14539
14542
14673
16442
16914
17338
18217
18297
18304
18665
18668
18669
19531
19536
19825
19838
20258
21919
22075
22586
28355
28359
28361
28452
28455
28483
28485
28489
28491
28582
32440
33245
33256
33259
33261
33263
33265
33267
33299
33301
33303
33305
33309
8985
14450
14460
14741
16128
16169
16170
16171
21451
22409
25379
25380
25620
25624
25657
25727
25729
25730
25731
25732
25733
25734
25735
25737
25739
25773
25774
25854
25909
25932
25934
25968
26003
26049
26148
26159
26160
26161
26163
26228
26232
26261
26262
26263
26264
26266
26267
26318
26322
26323
26324
26325
26326
26327
26328
26342
26367
26368
26393
26400
26401
26427
26439
26453
26455
26456
26457
26461
26509
26544
26546
26552
26569
26583
26585
26589
26598
26676
26678
26682
26703
26802
26804
26842
26847
26848
26849
26870
26871
26872
26873
26874
26914
26924
27007
27008
27009
27010
27011
27012
27013
27015
27016
27017
27059
27275
27279
27381
27384
27404
27409
27411
14693
27392
27394
32408
32429
32436
33016
14737
14739
25261
25264
25266
27466
27468
27492
27545
28315
28935
32402
32432
33006
33014
33022
33024
33187
28439
33214