Uninstalling Query Optimizer

Uninstall Query Optimizer in IBM® watsonx.data by following the instructions.

About this task

Uninstall Query Optimizer operator in watsonx.data by using the following steps:

Procedure

  1. Run the following command to list all engines:
    -- List engines
    oc get wxdengine -n ${PROJECT_CPD_INST_OPERANDS} -o custom-columns='Name:metadata.name,Display Name:spec.engineDisplayName'
  2. Run the following command to export the engine you want to uninstall Query Optimizer from:
    -- Select the engine to patch
    export ENGINE=<engine name>
  3. Run the following command to uninstall Query Optimizer from the engine by patching it:
    oc patch wxdengine $ENGINE -n ${PROJECT_CPD_INST_OPERANDS} --type json --patch '[
      { "op": "remove", "path": "/spec/wxd_query_optimizer" },
      { "op": "remove", "path": "/spec/enable_wxd_query_optimizer" },
      { "op": "remove", "path": "/spec/pull_prefix" },
      { "op": "remove", "path": "/spec/tag" },
      { "op": "remove", "path": "/spec/img_ref" }
    ]'
    Note: This patching will restart the engine automatically.
  4. Run the following command to check the status of uninstallation of Query Optimizer setup:
    watch "oc get wxdengine -n ${PROJECT_CPD_INST_OPERANDS} -o custom-columns='Name:metadata.name,Display Name:spec.engineDisplayName,RECONCILE:status.engineStatus,STATUS:status.middleEndStatus'"
    Note: Wait for the engine to finish reloading the Query Optimizer settings and show that the reconcile is “Completed”.
  5. Run the following command to uninstall all Query Optimizer resources that are no longer required from the operands namespace:
    oc delete db2 lakehouse-oaas -n ${PROJECT_CPD_INST_OPERANDS}
    oc delete secret ibm-lh-lakehouse-oaas-secret -n ${PROJECT_CPD_INST_OPERANDS}
  6. Run the following command to uninstall wxd_query_optimizer operator:
    cpd-cli manage delete-olm-artifacts \
    --cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} \
    --components=wxd_query_optimizer