Note that there are some explanatory texts on larger screens.

plurals
  1. POOptimize this query please
    primarykey
    data
    text
    <pre><code>SELECT B.CE_ID, A.PPL_CNTR_ID, SUM ( A.NBR_IN ) ENTERS, SUM ( A.NBR_OUT ) EXITS, A.LOG_TS + DECODE ( TO_CHAR ( A.LOG_TS, 'mi' ), '05', 55 / 1440, '10', 50 / 1440, '15', 45 / 1440, '20', 40 / 1440, '25', 35 / 1440, '30', 30 / 1440, '35', 25 / 1440, '40', 20 / 1440, '45', 15 / 1440, '50', 10 / 1440, '55', 5 / 1440, 0 ) TS FROM OUTPUTDB.TPPL_CNTR_TRAFFIC A, FLUX.V_CE_PPLCNTR B WHERE A.LOG_TS BETWEEN '07-Sep-13' AND '08-Sep-13' AND A.PPL_CNTR_ID = B.PPL_CNTR_ID AND B.CE_ID IN (SELECT DISTINCT CE_DPN_ID FROM TCE_RLT START WITH CE_PRN_ID = 5798 CONNECT BY PRIOR CE_DPN_ID = CE_PRN_ID) GROUP BY B.CE_ID, A.PPL_CNTR_ID, A.LOG_TS + DECODE ( TO_CHAR ( A.LOG_TS, 'mi' ), '05', 55 / 1440, '10', 50 / 1440, '15', 45 / 1440, '20', 40 / 1440, '25', 35 / 1440, '30', 30 / 1440, '35', 25 / 1440, '40', 20 / 1440, '45', 15 / 1440, '50', 10 / 1440, '55', 5 / 1440, 0 ) ORDER BY B.CE_ID, A.PPL_CNTR_ID, A.LOG_TS + DECODE ( TO_CHAR ( A.LOG_TS, 'mi' ), '05', 55 / 1440, '10', 50 / 1440, '15', 45 / 1440, '20', 40 / 1440, '25', 35 / 1440, '30', 30 / 1440, '35', 25 / 1440, '40', 20 / 1440, '45', 15 / 1440, '50', 10 / 1440, '55', 5 / 1440, 0 ) </code></pre> <p>The inner subquery</p> <pre><code> SELECT DISTINCT CE_DPN_ID FROM TCE_RLT START WITH CE_PRN_ID = 5798 CONNECT BY PRIOR CE_DPN_ID = CE_PRN_ID </code></pre> <p>returns 970 rows , But it's taking very long time to execute , Please suggest any alternate clause or joining so that It runs faster . The 2 tables used have only one column in common , So I am pretty sure no cross joining is taking place .</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload