Hi i am having duplicate entry/slow query in my dropshipping woocommerce website. also checked my php errorlog and i see over 4482 error that states below:
[12-Oct-2019 20:29:26 UTC] WordPress database error Duplicate entry '65444-9' for key 'PRIMARY' for query INSERT INTO `wp_term_relationships` (`object_id`, `term_taxonomy_id`) VALUES (65444, 9) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, adsw\Api\v1\Update->action, adsw\Api\v1\Actions\Actions->get_params, adsw\Api\v1\Actions\Update->action_update, adsw\Api\v1\Actions\Update->action_update_product, Ali\AliImport->update, Ali\AliImport->doUpdate, Ali\AliImport->updateVariations, wc_update_product_stock, WC_Product->save, WC_Data_Store->update, WC_Product_Variation_Data_Store_CPT->update, WC_Product_Variation_Data_Store_CPT->update_visibility, wp_set_post_terms, wp_set_object_terms
[13-Oct-2019 00:00:11 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8388616 bytes) in /home/customer/
[12-Oct-2019 20:29:26 UTC] WordPress database error Duplicate entry '65444-9' for key 'PRIMARY' for query INSERT INTO `wp_term_relationships` (`object_id`, `term_taxonomy_id`) VALUES (65444, 9) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, adsw\Api\v1\Update->action, adsw\Api\v1\Actions\Actions->get_params, adsw\Api\v1\Actions\Update->action_update, adsw\Api\v1\Actions\Update->action_update_product, Ali\AliImport->update, Ali\AliImport->doUpdate, Ali\AliImport->updateVariations, wc_update_product_stock, WC_Product->save, WC_Data_Store->update, WC_Product_Variation_Data_Store_CPT->update, WC_Product_Variation_Data_Store_CPT->update_visibility, wp_set_post_terms, wp_set_object_terms
[13-Oct-2019 00:00:11 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8388616 bytes) in /home/customer/
[12-Oct-2019 20:29:26 UTC] WordPress database error Duplicate entry '65444-9' for key 'PRIMARY' for query INSERT INTO `wp_term_relationships` (`object_id`, `term_taxonomy_id`) VALUES (65444, 9) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, adsw\Api\v1\Update->action, adsw\Api\v1\Actions\Actions->get_params, adsw\Api\v1\Actions\Update->action_update, adsw\Api\v1\Actions\Update->action_update_product, Ali\AliImport->update, Ali\AliImport->doUpdate, Ali\AliImport->updateVariations, wc_update_product_stock, WC_Product->save, WC_Data_Store->update, WC_Product_Variation_Data_Store_CPT->update, WC_Product_Variation_Data_Store_CPT->update_visibility, wp_set_post_terms, wp_set_object_terms
[13-Oct-2019 21:37:02 UTC] WordPress database error Duplicate entry '60033-9' for key 'PRIMARY' for query INSERT INTO `wp_term_relationships` (`object_id`, `term_taxonomy_id`) VALUES (60033, 9) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, adsw\Api\v1\Update->action, adsw\Api\v1\Actions\Actions->get_params, adsw\Api\v1\Actions\Update->action_update, adsw\Api\v1\Actions\Update->action_update_product, Ali\AliImport->update, Ali\AliImport->doUpdate, Ali\AliImport->updateVariations, wc_update_product_stock, WC_Product->save, WC_Data_Store->update, WC_Product_Variation_Data_Store_CPT->update, WC_Product_Variation_Data_Store_CPT->update_visibility, wp_set_post_terms, wp_set_object_terms, QM_DB->query
[12-Oct-2019 20:29:26 UTC] WordPress database error Duplicate entry '65444-9' for key 'PRIMARY' for query INSERT INTO `wp_term_relationships` (`object_id`, `term_taxonomy_id`) VALUES (65444, 9) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, adsw\Api\v1\Update->action, adsw\Api\v1\Actions\Actions->get_params, adsw\Api\v1\Actions\Update->action_update, adsw\Api\v1\Actions\Update->action_update_product, Ali\AliImport->update, Ali\AliImport->doUpdate, Ali\AliImport->updateVariations, wc_update_product_stock, WC_Product->save, WC_Data_Store->update, WC_Product_Variation_Data_Store_CPT->update, WC_Product_Variation_Data_Store_CPT->update_visibility, wp_set_post_terms, wp_set_object_terms
[13-Oct-2019 00:00:11 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8388616 bytes) in /home/customer/
[12-Oct-2019 20:29:26 UTC] WordPress database error Duplicate entry '65444-9' for key 'PRIMARY' for query INSERT INTO `wp_term_relationships` (`object_id`, `term_taxonomy_id`) VALUES (65444, 9) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, adsw\Api\v1\Update->action, adsw\Api\v1\Actions\Actions->get_params, adsw\Api\v1\Actions\Update->action_update, adsw\Api\v1\Actions\Update->action_update_product, Ali\AliImport->update, Ali\AliImport->doUpdate, Ali\AliImport->updateVariations, wc_update_product_stock, WC_Product->save, WC_Data_Store->update, WC_Product_Variation_Data_Store_CPT->update, WC_Product_Variation_Data_Store_CPT->update_visibility, wp_set_post_terms, wp_set_object_terms
[13-Oct-2019 00:00:11 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8388616 bytes) in /home/customer/
[12-Oct-2019 20:29:26 UTC] WordPress database error Duplicate entry '65444-9' for key 'PRIMARY' for query INSERT INTO `wp_term_relationships` (`object_id`, `term_taxonomy_id`) VALUES (65444, 9) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, adsw\Api\v1\Update->action, adsw\Api\v1\Actions\Actions->get_params, adsw\Api\v1\Actions\Update->action_update, adsw\Api\v1\Actions\Update->action_update_product, Ali\AliImport->update, Ali\AliImport->doUpdate, Ali\AliImport->updateVariations, wc_update_product_stock, WC_Product->save, WC_Data_Store->update, WC_Product_Variation_Data_Store_CPT->update, WC_Product_Variation_Data_Store_CPT->update_visibility, wp_set_post_terms, wp_set_object_terms
[13-Oct-2019 21:37:02 UTC] WordPress database error Duplicate entry '60033-9' for key 'PRIMARY' for query INSERT INTO `wp_term_relationships` (`object_id`, `term_taxonomy_id`) VALUES (60033, 9) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, adsw\Api\v1\Update->action, adsw\Api\v1\Actions\Actions->get_params, adsw\Api\v1\Actions\Update->action_update, adsw\Api\v1\Actions\Update->action_update_product, Ali\AliImport->update, Ali\AliImport->doUpdate, Ali\AliImport->updateVariations, wc_update_product_stock, WC_Product->save, WC_Data_Store->update, WC_Product_Variation_Data_Store_CPT->update, WC_Product_Variation_Data_Store_CPT->update_visibility, wp_set_post_terms, wp_set_object_terms, QM_DB->query