wso2/product-apim

Irrelevant queries executed while editing API from publisher UI

pasindujw opened this issue · 1 comments

Description:

From publisher UI, when editing an API which has subscriptions, when we select 'subscriptions' tab, we are seeing the following query getting executed twice.

SELECT IAT.ACCESS_TOKEN AS ACCESS_TOKEN, IAT.TOKEN_STATE AS TOKEN_STATE FROM AM_APPLICATION_KEY_MAPPING AKM, AM_SUBSCRIPTION SM,IDN_OAUTH2_ACCESS_TOKEN IAT, IDN_OAUTH_CONSUMER_APPS ICA WHERE SM.SUBSCRIPTION_ID = 948 AND SM.APPLICATION_ID= AKM.APPLICATION_ID AND ICA.CONSUMER_KEY = AKM.CONSUMER_KEY AND ICA.ID = IAT.CONSUMER_KEY_ID

Seems this query is not required for that page.

As the query refers to a possibly-big table IDN_OAUTH2_ACCESS_TOKEN, it would be better to remove executing this to avoid unnecessary latency.

Steps to reproduce:

Can check the query by enabling correlation logs and trying to edit an API.

Affected Product Version:

APIM 3.1.0

Environment details (with versions):

  • OS:
  • Client:
  • Env (Docker/K8s):

Optional Fields

Related Issues:

Suggested Labels:

Suggested Assignees:

@shilmyhasan can you check and close this please