Oracle / PLSQL性能提示

时间:2017-07-04 15:42:29

标签: oracle plsql

我的查询中存在问题。当我添加 ROUND DECODE 查询需要太长时间但是当我直接删除返回值时。当我搜索SQL建议没有任何建议。我如何修复这2个语法?

SELECT I.*, 
Q.INVOICE_DATE, 
Q.SERIES_ID IFS_SERIES_ID, 
Q.INVOICE_NO, 
Q.IDENTITY, 
Q.IDENTITY_NAME, 
Q.ASSOCIATION_NO, 
Q.NET_CURR_AMOUNT, 
Q.VAT_CURR_AMOUNT, 
Q.TOTAL_CURR_AMOUNT, 
Q.CURRENCY_CODE, 
ROUND(Q.CURR_RATE,:"SYS_B_0") CURR_RATE, 
Q.PROFILE_ID DEFAULT_PROFILE_ID, 
X.XML_CONTENT, 
DECODE(NVL(DBMS_LOB.INSTR(X.XML_CONTENT,:"SYS_B_1",:"SYS_B_2",:"SYS_B_3"), :"SYS_B_4"), :"SYS_B_5",:"SYS_B_6", :"SYS_B_7") SINGED_UBL, 
X.SCHEMATRON_RESULT, 
q.SHIPMENT_ID, 
IFSAPP.TREF_UTILITY_API.GET_DESPATCH_NUMBER(I.COMPANY, I.INVOICE_ID) DESPATCH_REFERENCE, 
X.OBJID XML_OBJID, 
X.OBJVERSION XML_OBJVERSION, 
IFSAPP.TREF_MODULE_API.GET_DESCRIPTION(I.MODULE_ID) MODULE_NAME 
FROM IFSAPP.TREF_INVOICE I, 
IFSAPP.TREF_INVOICE_INFO_QRY Q, 
IFSAPP.TREF_XML_ARCHIVE X 
WHERE Q.COMPANY = I.COMPANY 
AND Q.INVOICE_ID = I.INVOICE_ID 
AND X.XML_ARCHIVE_ID(+) = I.XML_ARCHIVE_ID 
AND I.COMPANY = :COMPANY 
AND I.INVOICE_ID = :INVOICE_ID

1 个答案:

答案 0 :(得分:0)

您应该跟踪每个语句的一个或多个执行,以确切了解它的作用。在对跟踪数据进行概要分析时,您将知道该做什么。

def queueStatus(String queueNum, String estensionNum){
   try{
       QueueStatusAction queueStatusAction;
       ManagerResponse originateResponse;
       queueStatusAction = new QueueStatusAction()
       queueStatusAction.setQueue(queueNum.toString())
       queueStatusAction.setChannel("SIP/" + estensionNum.toString())
       print queueStatusAction
       originateResponse = 
       managerConnection.sendAction(queueStatusAction, 2000)
       println originateResponse.getMessage()
   }catch(Exception e){
          println e
   }
}