Explain SQL Query execution plan: Oracle

Dear Masters,
Kindly help me to understand execution plan for an SQL statement. I have following SQL execution plan for a query in system. How should I interpret it. I thank You in advace for your guidance.
SELECT STATEMENT ( Estimated Costs = 1.372.413 , Estimated #Rows = 0 )
       5 NESTED LOOPS
         ( Estim. Costs = 1.372.413 , Estim. #Rows = 3.125 )
         Estim. CPU-Costs = 55.798.978.498 Estim. IO-Costs = 1.366.482
           2 TABLE ACCESS BY INDEX ROWID MSEG
             ( Estim. Costs = 1.326.343 , Estim. #Rows = 76.717 )
             Estim. CPU-Costs = 55.429.596.575 Estim. IO-Costs = 1.320.451
             Filter Predicates
               1 INDEX RANGE SCAN MSEG~R
                 ( Estim. Costs = 89.322 , Estim. #Rows = 60.069.500 )
                 Search Columns: 1
                 Estim. CPU-Costs = 2.946.739.229 Estim. IO-Costs = 89.009
                 Access Predicates
           4 TABLE ACCESS BY INDEX ROWID MKPF
             ( Estim. Costs = 1 , Estim. #Rows = 1 )
             Estim. CPU-Costs = 4.815 Estim. IO-Costs = 1
             Filter Predicates
               3 INDEX UNIQUE SCAN MKPF~0
                 Search Columns: 3
                 Estim. CPU-Costs = 3.229 Estim. IO-Costs = 0
                 Access Predicates

Hi Panjak,
Yeahh, there's a huge unperformatic SQL statment, what I can see from this acces plan is:
1 DBO decided to start the query on index R on MSEG, using only part of the index (only one column) with no good uniqueness, accessing disk IO-Costs for this (60mi records), and expecting many interactions (loops) in memory to filter, see CPU-Costs.
So with the parameters you gave to SQL, they start in a very bad way.
2 After that program will access the MSEG commanded by what was found on First step, also with a huge loading from DB and filtering (another where criteria on MSEG fields, not found on index R), reducing the result set to 76.717 rows.
3/4 With this, program goes direct to primary key index on MKPF with direct access (optimized access) and follow to access database table MKPF.
5 At last will "loop" the result sets from MSEG and MKPF, mixing the tuplas generating the final result set.
Do you want to share your SQL, the parameters you are sending and code which generate it with us?
Regards, Fernando Da Ró

Similar Messages

  • Query Execution plan

    Hi,
    I have a question about reading query execution plans. I don't understand what is meant by "Hash join" in a plan step. I understand "Nested_Loops" and "Merge_Join", but after looking at different documentations, I am still not clear about "Hash_Join". Please don't give links to Oracle documentation, because I have seen a lot of it, but it is still not clear. I also don't fully understand what is meant by a "Hash Table", what are all these "Hashesssssss"???
    Please explain in your own words, if possible, and with the help of some example.
    Thanks in Advance.,

    user566817 wrote:
    Can any one else answer my question? I would be highly thankful.Hash joins are one of the 3 techniques used by Oracle to join to sets of data.
    As a brief, and very very crude overview
    Generally after applying the filter to one data source, the join key is hashed into a memory table (as described by link sb provided). The second data set areas filtered and it's join key is also hashed, but the hash is used to find matches in the memory table created by the first data source. Assuming no hash chaining, found matches are joins; if hassh chaining exists, the chain needs to be traversed to verify joins.
    This, of course, has a lot of holes which would be filled in by the documentation and by external links that you do not seem to want to use.
    (Remember: School papers need to cite references. Teachers these days DO check.)

  • Current running SQL stms execution plan?

    Hi,
    Is it any ways to findout the current running SQL stms execution plan?
    without using Explain plan & autotrace.
    Thanks in advance,
    Thomas.

    I'm using this code. You just have to give the Session Identifier (&SID ):SELECT     '| Operation                                     |  Objet   | Lignes| Bytes|  Cout  | Pstart| Pstop |' as "Plan Table"  FROM DUAL
    UNION ALL
    SELECT     '----------------------------------------------------------------------------------------------------' FROM DUAL
    UNION ALL
    SELECT * FROM
             (SELECT /*+ NO_MERGE */
              RPAD('| '||
                   SUBSTR(
                        LPAD(' ',1*(LEVEL-1)) || OPERATION || DECODE(OPTIONS, NULL,'',' '||OPTIONS), 1, 47
                         ), 48, ' '
              )||'|'||
              RPAD(
                   SUBSTR(OBJECT_NAME||' ',1, 9), 10, ' '
              )||'|'||
              LPAD(
                   DECODE(CARDINALITY,
                        NULL,'  ',
                        DECODE(SIGN(CARDINALITY-1000),
                              -1, CARDINALITY||' ',
                             DECODE(SIGN(CARDINALITY-1000000),
                                   -1,TRUNC(CARDINALITY/1000)||'K',
                                  DECODE(SIGN(CARDINALITY-1000000000),
                                       -1,TRUNC(CARDINALITY/1000000)||'M',
                                       TRUNC(CARDINALITY/1000000000)||'G')
                        ), 7, ' '
              )||'|'||
              LPAD(
                   DECODE(BYTES,
                        NULL,' ',
                        DECODE(SIGN(BYTES-1024),
                             -1, BYTES||' ',
                             DECODE(SIGN(BYTES-1048576),
                                  -1, TRUNC(BYTES/1024)||'K',
                                  DECODE(SIGN(BYTES-1073741824),
                                       -1,TRUNC(BYTES/1048576)||'M',
                                       TRUNC(BYTES/1073741824)||'G')
                        ), 6, ' '
              )||'|'||
              LPAD(
                   DECODE(COST,
                        NULL,' ',
                        DECODE(SIGN(COST-10000000),
                             -1, COST||' ',
                             DECODE(SIGN(COST-1000000000),
                                  -1, TRUNC(COST/1000000)||'M',
                                  TRUNC(COST/1000000000)||'G')
                        ), 8, ' '
              )||'|'||
              LPAD(
                   DECODE(PARTITION_START,
                        'ROW LOCATION', 'ROWID',
                        DECODE(PARTITION_START,
                             'KEY', 'KEY',
                             DECODE(PARTITION_START,
                                  'KEY(INLIST)', 'KEY(I)',
                                  DECODE(SUBSTR(PARTITION_START, 1, 6),
                                       'NUMBER', SUBSTR(SUBSTR(PARTITION_START, 8, 10), 1,LENGTH(SUBSTR(PARTITION_START, 8, 10))-1),
                                       DECODE(PARTITION_START,
                                            NULL,' ',
                                            PARTITION_START)
                        )||' ', 7, ' '
              )||'|'||
              LPAD(
                   DECODE(PARTITION_STOP,
                        'ROW LOCATION', 'ROW L',
                        DECODE(PARTITION_STOP,
                             'KEY', 'KEY',
                             DECODE(PARTITION_STOP,
                                  'KEY(INLIST)', 'KEY(I)',
                                  DECODE(SUBSTR(PARTITION_STOP, 1, 6),
                                  'NUMBER', SUBSTR(SUBSTR(PARTITION_STOP, 8, 10), 1,LENGTH(SUBSTR(PARTITION_STOP, 8, 10))-1),
                                  DECODE(PARTITION_STOP,
                                       NULL,' ',
                                       PARTITION_STOP)
                   )||' ', 7, ' '
              )||'|' AS "Explain plan"
         FROM V$SQL_PLAN
         START WITH (ADDRESS = (SELECT SQL_ADDRESS FROM V$SESSION WHERE SID=&SID)
                   AND HASH_VALUE = (SELECT SQL_HASH_VALUE FROM V$SESSION WHERE SID=&SID)
                   AND CHILD_NUMBER = 0
                   AND ID=0 )
         CONNECT BY PRIOR ID = PARENT_ID
                        AND PRIOR ADDRESS = ADDRESS
                        AND PRIOR HASH_VALUE = HASH_VALUE
                        AND PRIOR CHILD_NUMBER = CHILD_NUMBER
         ORDER BY ID, POSITION)
    UNION ALL
    SELECT '----------------------------------------------------------------------------------------------------' FROM DUAL;Regards,
    Yoann.

  • Query Execution Plans Change between 2 servers even when we have same data.

    Hi Friends,
    Currently One of the Query which normally takes 15 seconds but it started taking 160 seconds.So same query was executed on the secondary site and the query returned in 15 seconds which is expected.Raised a call with ORacle and they are still investigating since 27th Sept.
    Oracle version=11.2.0.2
    OS=Solaris 10.
    Issue DB execution plan
    select * From  tibex_openinghomemktok as of scn 17032999332 where meid='ME1'
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.12       0.12          0          0          0           0
    Execute      1    161.20     161.21         55    1539719        206           0
    Fetch        6      0.05       0.05        190        386          1         464
    total        8    161.37     161.38        245    1540105        207         464
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 191
    Number of plan statistics captured: 1
    Rows (1st) Rows (avg) Rows (max)  Row Source Operation
           464        464        464  VIEW  TIBEX_OPENINGHOMEMKTOK (cr=1540105 pr=245 pw=191 time=161246176 us cost=149 size=291 card=1)
           464        464        464   TEMP TABLE TRANSFORMATION  (cr=1540105 pr=245 pw=191 time=161245860 us)
             0          0          0    LOAD AS SELECT  (cr=27 pr=0 pw=1 time=24101 us)
            13         13         13     HASH JOIN  (cr=27 pr=0 pw=0 time=13149 us cost=35 size=1408 card=8)
             1          1          1      TABLE ACCESS FULL TIBEX_TRADINGMETHODENUM (cr=2 pr=0 pw=0 time=83 us cost=5 size=14 card=1)
           235        235        235      HASH JOIN  (cr=25 pr=0 pw=0 time=12612 us cost=30 size=22356 card=138)
           235        235        235       NESTED LOOPS OUTER (cr=21 pr=0 pw=0 time=11568 us cost=22 size=16560 card=138)
           235        235        235        HASH JOIN  (cr=20 pr=0 pw=0 time=10831 us cost=22 size=10074 card=138)
            40         40         40         HASH JOIN  (cr=18 pr=0 pw=0 time=8119 us cost=17 size=2200 card=40)
            40         40         40          HASH JOIN OUTER (cr=12 pr=0 pw=0 time=5920 us cost=13 size=1320 card=40)
            40         40         40           NESTED LOOPS  (cr=10 pr=0 pw=0 time=4155 us cost=3 size=800 card=40)
            80         80         80            VIEW  index$_join$_018 (cr=6 pr=0 pw=0 time=4245 us cost=3 size=1040 card=80)
            80         80         80             HASH JOIN  (cr=6 pr=0 pw=0 time=3057 us)
            80         80         80              INDEX FAST FULL SCAN XAK1TIBEX_TRADINGCYCLE (cr=3 pr=0 pw=0 time=169 us cost=1 size=1040 card=80)(object id 1354894)
            80         80         80              INDEX FAST FULL SCAN XPKTIBEX_TRADINGCYCLE (cr=3 pr=0 pw=0 time=70 us cost=1 size=1040 card=80)(object id 1354895)
            40         40         40            INDEX UNIQUE SCAN XPKTIBEX_DAYSTRADINGCYCLEMAP (cr=4 pr=0 pw=0 time=152 us cost=0 size=7 card=1)(object id 1354685)
             0          0          0           VIEW  (cr=2 pr=0 pw=0 time=316 us cost=10 size=143 card=11)
             0          0          0            HASH JOIN  (cr=2 pr=0 pw=0 time=315 us cost=8 size=352 card=11)
             0          0          0             MERGE JOIN  (cr=2 pr=0 pw=0 time=118 us cost=4 size=209 card=11)
             0          0          0              TABLE ACCESS BY INDEX ROWID TIBEX_HOLIDAYS (cr=2 pr=0 pw=0 time=113 us cost=2 size=26 card=2)
            83         83         83               INDEX FULL SCAN XPKTIBEX_HOLIDAYS (cr=1 pr=0 pw=0 time=113 us cost=1 size=0 card=83)(object id 1354737)
             0          0          0              SORT JOIN (cr=0 pr=0 pw=0 time=0 us cost=2 size=2412 card=402)
             0          0          0               INDEX FULL SCAN XPKTIBEX_HOLIDAYTRADINGCYCLEMA (cr=0 pr=0 pw=0 time=0 us cost=1 size=2412 card=402)(object id 1354739)
             0          0          0             VIEW  index$_join$_023 (cr=0 pr=0 pw=0 time=0 us cost=3 size=1040 card=80)
             0          0          0              HASH JOIN  (cr=0 pr=0 pw=0 time=0 us)
             0          0          0               INDEX FAST FULL SCAN XAK1TIBEX_TRADINGCYCLE (cr=0 pr=0 pw=0 time=0 us cost=1 size=1040 card=80)(object id 1354894)
             0          0          0               INDEX FAST FULL SCAN XPKTIBEX_TRADINGCYCLE (cr=0 pr=0 pw=0 time=0 us cost=1 size=1040 card=80)(object id 1354895)
            80         80         80          VIEW  index$_join$_024 (cr=6 pr=0 pw=0 time=1121 us cost=3 size=1760 card=80)
            80         80         80           HASH JOIN  (cr=6 pr=0 pw=0 time=1040 us)
            80         80         80            INDEX FAST FULL SCAN XAK1TIBEX_TRADINGCYCLE (cr=3 pr=0 pw=0 time=66 us cost=1 size=1760 card=80)(object id 1354894)
            80         80         80            INDEX FAST FULL SCAN XPKTIBEX_TRADINGCYCLE (cr=3 pr=0 pw=0 time=57 us cost=1 size=1760 card=80)(object id 1354895)
           275        275        275         TABLE ACCESS FULL TIBEX_CYCLEPERIODMAP (cr=2 pr=0 pw=0 time=229 us cost=5 size=4950 card=275)
             0          0          0        TABLE ACCESS BY INDEX ROWID TIBEX_CYCLEPERIODMAPOVER (cr=1 pr=0 pw=0 time=384 us cost=0 size=47 card=1)
             0          0          0         INDEX UNIQUE SCAN XPKTIBEX_CYCLEPERIODMAPOVER (cr=1 pr=0 pw=0 time=135 us cost=0 size=0 card=1)(object id 1354925)
           330        330        330       TABLE ACCESS FULL TIBEX_TRADINGPERIOD (cr=4 pr=0 pw=0 time=61 us cost=7 size=13860 card=330)
             0          0          0    LOAD AS SELECT  (cr=1539692 pr=55 pw=190 time=161190726 us)
         12435      12435      12435     NESTED LOOPS  (cr=1539692 pr=55 pw=0 time=158262964 us cost=109 size=284 card=1)
         12435      12435      12435      FILTER  (cr=1539688 pr=55 pw=0 time=158208902 us)
        497400     497400     497400       NESTED LOOPS OUTER (cr=1539688 pr=55 pw=0 time=212847780 us cost=109 size=280 card=1)
        497400     497400     497400        NESTED LOOPS  (cr=544888 pr=55 pw=0 time=60349504 us cost=108 size=267 card=1)
        497400     497400     497400         MERGE JOIN CARTESIAN (cr=47484 pr=55 pw=0 time=57182690 us cost=107 size=254 card=1)
         12435      12435      12435          NESTED LOOPS  (cr=47483 pr=55 pw=0 time=2368168 us cost=106 size=247 card=1)
         13877      13877      13877           NESTED LOOPS  (cr=33602 pr=55 pw=0 time=5930848 us cost=105 size=233 card=1)
          1473       1473       1473            NESTED LOOPS  (cr=212 pr=2 pw=0 time=9371 us cost=35 size=390 card=3)
            13         13         13             HASH JOIN  (cr=193 pr=1 pw=0 time=8029 us cost=34 size=116 card=1)
            13         13         13              NESTED LOOPS  (cr=191 pr=1 pw=0 time=7255 us cost=31 size=95 card=1)
           338        338        338               HASH JOIN  (cr=187 pr=1 pw=0 time=6329 us cost=31 size=2821 card=31)
            13         13         13                VIEW  VW_NSO_1 (cr=184 pr=1 pw=0 time=5958 us cost=26 size=26 card=1)
            13         13         13                 SORT GROUP BY (cr=184 pr=1 pw=0 time=5954 us cost=26 size=115 card=1)
            65         65         65                  NESTED LOOPS ANTI (cr=184 pr=1 pw=0 time=5898 us cost=25 size=115 card=1)
            78         78         78                   NESTED LOOPS  (cr=102 pr=1 pw=0 time=6140 us cost=24 size=101 card=1)
            78         78         78                    NESTED LOOPS OUTER (cr=20 pr=1 pw=0 time=5341 us cost=23 size=94 card=1)
            78         78         78                     HASH JOIN  (cr=19 pr=1 pw=0 time=5077 us cost=23 size=55 card=1)
            13         13         13                      HASH JOIN  (cr=17 pr=1 pw=0 time=4056 us cost=17 size=352 card=8)
            40         40         40                       NESTED LOOPS  (cr=13 pr=0 pw=0 time=3300 us cost=15 size=1480 card=40)
            40         40         40                        HASH JOIN OUTER (cr=9 pr=0 pw=0 time=2928 us cost=15 size=1320 card=40)
            40         40         40                         HASH JOIN  (cr=7 pr=0 pw=0 time=1976 us cost=5 size=800 card=40)
            40         40         40                          INDEX RANGE SCAN XPKTIBEX_DAYSTRADINGCYCLEMAP (cr=1 pr=0 pw=0 time=120 us cost=1 size=280 card=40)(object id 1354685)
            80         80         80                          VIEW  index$_join$_044 (cr=6 pr=0 pw=0 time=1251 us cost=3 size=1040 card=80)
            80         80         80                           HASH JOIN  (cr=6 pr=0 pw=0 time=1249 us)
            80         80         80                            INDEX FAST FULL SCAN XAK1TIBEX_TRADINGCYCLE (cr=3 pr=0 pw=0 time=70 us cost=1 size=1040 card=80)(object id 1354894)
            80         80         80                            INDEX FAST FULL SCAN XPKTIBEX_TRADINGCYCLE (cr=3 pr=0 pw=0 time=135 us cost=1 size=1040 card=80)(object id 1354895)
             0          0          0                         VIEW  (cr=2 pr=0 pw=0 time=295 us cost=10 size=143 card=11)
             0          0          0                          HASH JOIN  (cr=2 pr=0 pw=0 time=293 us cost=8 size=352 card=11)
             0          0          0                           MERGE JOIN  (cr=2 pr=0 pw=0 time=118 us cost=4 size=209 card=11)
             0          0          0                            TABLE ACCESS BY INDEX ROWID TIBEX_HOLIDAYS (cr=2 pr=0 pw=0 time=113 us cost=2 size=26 card=2)
            83         83         83                             INDEX FULL SCAN XPKTIBEX_HOLIDAYS (cr=1 pr=0 pw=0 time=116 us cost=1 size=0 card=83)(object id 1354737)
             0          0          0                            SORT JOIN (cr=0 pr=0 pw=0 time=0 us cost=2 size=2412 card=402)
             0          0          0                             INDEX FULL SCAN XPKTIBEX_HOLIDAYTRADINGCYCLEMA (cr=0 pr=0 pw=0 time=0 us cost=1 size=2412 card=402)(object id 135473
    9)
             0          0          0                           VIEW  index$_join$_049 (cr=0 pr=0 pw=0 time=0 us cost=3 size=1040 card=80)
             0          0          0                            HASH JOIN  (cr=0 pr=0 pw=0 time=0 us)
             0          0          0                             INDEX FAST FULL SCAN XAK1TIBEX_TRADINGCYCLE (cr=0 pr=0 pw=0 time=0 us cost=1 size=1040 card=80)(object id 1354894)
             0          0          0                             INDEX FAST FULL SCAN XPKTIBEX_TRADINGCYCLE (cr=0 pr=0 pw=0 time=0 us cost=1 size=1040 card=80)(object id 1354895)
            40         40         40                        INDEX UNIQUE SCAN XPKTIBEX_TRADINGCYCLE (cr=4 pr=0 pw=0 time=79 us cost=0 size=4 card=1)(object id 1354895)
            13         13         13                       VIEW  (cr=4 pr=1 pw=0 time=362 us cost=2 size=112 card=16)
            13         13         13                        TABLE ACCESS FULL SYS_TEMP_0FD9D660D_F7392ACA (cr=4 pr=1 pw=0 time=349 us cost=2 size=1216 card=16)
           275        275        275                      TABLE ACCESS FULL TIBEX_CYCLEPERIODMAP (cr=2 pr=0 pw=0 time=164 us cost=5 size=3025 card=275)
             0          0          0                     TABLE ACCESS BY INDEX ROWID TIBEX_CYCLEPERIODMAPOVER (cr=1 pr=0 pw=0 time=136 us cost=0 size=39 card=1)
             0          0          0                      INDEX UNIQUE SCAN XPKTIBEX_CYCLEPERIODMAPOVER (cr=1 pr=0 pw=0 time=52 us cost=0 size=0 card=1)(object id 1354925)
            78         78         78                    TABLE ACCESS BY INDEX ROWID TIBEX_TRADINGPERIOD (cr=82 pr=0 pw=0 time=343 us cost=1 size=7 card=1)
            78         78         78                     INDEX UNIQUE SCAN XPKTIBEX_TRADINGPERIOD (cr=4 pr=0 pw=0 time=144 us cost=0 size=0 card=1)(object id 1354899)
            13         13         13                   TABLE ACCESS BY INDEX ROWID TIBEX_TRADINGMETHODENUM (cr=82 pr=0 pw=0 time=252 us cost=1 size=14 card=1)
            78         78         78                    INDEX UNIQUE SCAN XPKTIBEX_TRADINGMETHODENUM (cr=4 pr=0 pw=0 time=98 us cost=0 size=0 card=1)(object id 1354897)
             0          0          0                             INDEX FAST FULL SCAN XPKTIBEX_TRADINGCYCLE (cr=0 pr=0 pw=0 time=0 us cost=1 size=1040 card=80)(object id 1354895)
            40         40         40                        INDEX UNIQUE SCAN XPKTIBEX_TRADINGCYCLE (cr=4 pr=0 pw=0 time=79 us cost=0 size=4 card=1)(object id 1354895)
            13         13         13                       VIEW  (cr=4 pr=1 pw=0 time=362 us cost=2 size=112 card=16)
            13         13         13                        TABLE ACCESS FULL SYS_TEMP_0FD9D660D_F7392ACA (cr=4 pr=1 pw=0 time=349 us cost=2 size=1216 card=16)
           275        275        275                      TABLE ACCESS FULL TIBEX_CYCLEPERIODMAP (cr=2 pr=0 pw=0 time=164 us cost=5 size=3025 card=275)
             0          0          0                     TABLE ACCESS BY INDEX ROWID TIBEX_CYCLEPERIODMAPOVER (cr=1 pr=0 pw=0 time=136 us cost=0 size=39 card=1)
             0          0          0                      INDEX UNIQUE SCAN XPKTIBEX_CYCLEPERIODMAPOVER (cr=1 pr=0 pw=0 time=52 us cost=0 size=0 card=1)(object id 1354925)
            78         78         78                    TABLE ACCESS BY INDEX ROWID TIBEX_TRADINGPERIOD (cr=82 pr=0 pw=0 time=343 us cost=1 size=7 card=1)
            78         78         78                     INDEX UNIQUE SCAN XPKTIBEX_TRADINGPERIOD (cr=4 pr=0 pw=0 time=144 us cost=0 size=0 card=1)(object id 1354899)
            13         13         13                   TABLE ACCESS BY INDEX ROWID TIBEX_TRADINGMETHODENUM (cr=82 pr=0 pw=0 time=252 us cost=1 size=14 card=1)
            78         78         78                    INDEX UNIQUE SCAN XPKTIBEX_TRADINGMETHODENUM (cr=4 pr=0 pw=0 time=98 us cost=0 size=0 card=1)(object id 1354897)
           275        275        275                MERGE JOIN OUTER (cr=3 pr=0 pw=0 time=892 us cost=5 size=17875 card=275)
           275        275        275                 TABLE ACCESS BY INDEX ROWID TIBEX_CYCLEPERIODMAP (cr=2 pr=0 pw=0 time=401 us cost=2 size=4950 card=275)
           275        275        275                  INDEX FULL SCAN XPKTIBEX_CYCLEPERIODMAP (cr=1 pr=0 pw=0 time=115 us cost=1 size=0 card=275)(object id 1354681)
             0          0          0                 SORT JOIN (cr=1 pr=0 pw=0 time=207 us cost=3 size=47 card=1)
             0          0          0                  TABLE ACCESS FULL TIBEX_CYCLEPERIODMAPOVER (cr=1 pr=0 pw=0 time=17 us cost=2 size=47 card=1)
            13         13         13               INDEX UNIQUE SCAN XPKTIBEX_TRADINGCYCLE (cr=4 pr=0 pw=0 time=349 us cost=0 size=4 card=1)(object id 1354895)
            13         13         13              VIEW  (cr=2 pr=0 pw=0 time=52 us cost=2 size=336 card=16)
            13         13         13               TABLE ACCESS FULL SYS_TEMP_0FD9D660D_F7392ACA (cr=2 pr=0 pw=0 time=49 us cost=2 size=1216 card=16)
          1473       1473       1473             INDEX RANGE SCAN XPKTIBEX_INSTRUMENTBOARDMAP (cr=19 pr=1 pw=0 time=1378 us cost=1 size=504 card=36)(object id 1354759)
         13877      13877      13877            TABLE ACCESS BY INDEX ROWID TIBEX_INSTRUMENTADMIN (cr=33390 pr=53 pw=0 time=2023879 us cost=27 size=103 card=1)
         44576      44576      44576             INDEX RANGE SCAN SYS_C001331991 (cr=1277 pr=53 pw=0 time=43026 us cost=1 size=0 card=35)(object id 1354964)
         12435      12435      12435           TABLE ACCESS BY INDEX ROWID TIBEX_INSTRACTIONENUM (cr=13881 pr=0 pw=0 time=81117 us cost=1 size=14 card=1)
         13877      13877      13877            INDEX UNIQUE SCAN XPKTIBEX_INSTRACTIONENUM (cr=4 pr=0 pw=0 time=32628 us cost=0 size=0 card=1)(object id 1354753)
        497400     497400     497400          BUFFER SORT (cr=1 pr=0 pw=0 time=323076 us cost=106 size=280 card=40)
            40         40         40           INDEX RANGE SCAN XPKTIBEX_DAYSTRADINGCYCLEMAP (cr=1 pr=0 pw=0 time=61 us cost=1 size=280 card=40)(object id 1354685)
        497400     497400     497400         TABLE ACCESS BY INDEX ROWID TIBEX_TRADINGCYCLE (cr=497404 pr=0 pw=0 time=2609562 us cost=1 size=13 card=1)
        497400     497400     497400          INDEX UNIQUE SCAN XPKTIBEX_TRADINGCYCLE (cr=4 pr=0 pw=0 time=1019970 us cost=0 size=0 card=1)(object id 1354895)
             0          0          0        VIEW PUSHED PREDICATE  (cr=994800 pr=0 pw=0 time=151415026 us cost=1 size=13 card=1)
             0          0          0         HASH JOIN  (cr=994800 pr=0 pw=0 time=150806856 us cost=7 size=32 card=1)
             0          0          0          MERGE JOIN  (cr=994800 pr=0 pw=0 time=19714460 us cost=4 size=209 card=11)
             0          0          0           TABLE ACCESS BY INDEX ROWID TIBEX_HOLIDAYS (cr=994800 pr=0 pw=0 time=18729534 us cost=2 size=26 card=2)
      41284200   41284200   41284200            INDEX FULL SCAN XPKTIBEX_HOLIDAYS (cr=497400 pr=0 pw=0 time=16264606 us cost=1 size=0 card=83)(object id 1354737)
             0          0          0           SORT JOIN (cr=0 pr=0 pw=0 time=0 us cost=2 size=2412 card=402)
             0          0          0            INDEX FULL SCAN XPKTIBEX_HOLIDAYTRADINGCYCLEMA (cr=0 pr=0 pw=0 time=0 us cost=1 size=2412 card=402)(object id 1354739)
             0          0          0          TABLE ACCESS BY INDEX ROWID TIBEX_TRADINGCYCLE (cr=0 pr=0 pw=0 time=0 us cost=2 size=26 card=2)
             0          0          0           INDEX RANGE SCAN XAK1TIBEX_TRADINGCYCLE (cr=0 pr=0 pw=0 time=0 us cost=1 size=0 card=2)(object id 1354894)
         12435      12435      12435      INDEX UNIQUE SCAN XPKTIBEX_TRADINGPERIOD (cr=4 pr=0 pw=0 time=33106 us cost=0 size=4 card=1)(object id 1354899)
           464        464        464    HASH JOIN SEMI (cr=386 pr=190 pw=0 time=30227 us cost=6 size=331 card=1)
          5684       5684       5684     VIEW  (cr=194 pr=190 pw=0 time=8864 us cost=2 size=582 card=2)
         12435      12435      12435      TABLE ACCESS FULL SYS_TEMP_0FD9D660E_F7392ACA (cr=194 pr=190 pw=0 time=9137 us cost=2 size=272 card=2)
          1267       1267       1267     VIEW  VW_NSO_2 (cr=192 pr=0 pw=0 time=13710 us cost=3 size=80 card=2)
          1267       1267       1267      HASH GROUP BY (cr=192 pr=0 pw=0 time=13074 us cost=3 size=38 card=2)
         12435      12435      12435       VIEW  (cr=192 pr=0 pw=0 time=11843 us cost=2 size=38 card=2)
         12435      12435      12435        TABLE ACCESS FULL SYS_TEMP_0FD9D660E_F7392ACA (cr=192 pr=0 pw=0 time=5751 us cost=2 size=272 card=2)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      Disk file operations I/O                        1        0.00          0.00
      direct path write temp                          2        0.00          0.00
      direct path sync                                1        0.00          0.00
      db file sequential read                        55        0.00          0.00
      SQL*Net message to client                       6        0.00          0.00
      db file scattered read                          2        0.00          0.00
      SQL*Net message from client                     6        0.00          0.00Regards
    NM

    Hi,
    Execution Plan after generating stats on TIBEX_TRADINGCYCLE.
    Execution Plan
    Plan hash value: 1209012613
    | Id  | Operation                                               | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                                        |                                |     1 |   291 |   130   (7)| 00:00:02 |
    |   1 |  VIEW                                                   | TIBEX_OPENINGHOMEMKTOK         |     1 |   291 |   130   (7)| 00:00:02 |
    |   2 |   TEMP TABLE TRANSFORMATION                             |                                |       |       |            |          |
    |   3 |    LOAD AS SELECT                                       | SYS_TEMP_0FD9D662B_FB42A6E1    |       |       |            |          |
    |*  4 |     HASH JOIN                                           |                                |     8 |  1392 |    27  (12)| 00:00:01 |
    |*  5 |      TABLE ACCESS FULL                                  | TIBEX_TRADINGMETHODENUM        |     1 |    14 |     5   (0)| 00:00:01 |
    |*  6 |      HASH JOIN                                          |                                |   138 | 22080 |    21  (10)| 00:00:01 |
    |   7 |       NESTED LOOPS OUTER                                |                                |   138 | 16284 |    14  (15)| 00:00:01 |
    |*  8 |        HASH JOIN                                        |                                |   138 |  9798 |    14  (15)| 00:00:01 |
    |*  9 |         HASH JOIN                                       |                                |    40 |  2120 |     8  (13)| 00:00:01 |
    |  10 |          NESTED LOOPS OUTER                             |                                |    40 |  1240 |     5   (0)| 00:00:01 |
    |  11 |           NESTED LOOPS                                  |                                |    40 |   800 |     3  (34)| 00:00:01 |
    |  12 |            VIEW                                         | index$_join$_018               |    80 |  1040 |     3  (34)| 00:00:01 |
    |* 13 |             HASH JOIN                                   |                                |       |       |            |          |
    |  14 |              INDEX FAST FULL SCAN                       | XAK1TIBEX_TRADINGCYCLE         |    80 |  1040 |     1   (0)| 00:00:01 |
    |  15 |              INDEX FAST FULL SCAN                       | XPKTIBEX_TRADINGCYCLE          |    80 |  1040 |     1   (0)| 00:00:01 |
    |* 16 |            INDEX UNIQUE SCAN                            | XPKTIBEX_DAYSTRADINGCYCLEMAP   |     1 |     7 |     0   (0)| 00:00:01 |
    |  17 |           VIEW PUSHED PREDICATE                         |                                |     1 |    11 |     1   (0)| 00:00:01 |
    |* 18 |            HASH JOIN                                    |                                |     1 |    32 |     7  (29)| 00:00:01 |
    |  19 |             MERGE JOIN                                  |                                |     3 |    57 |     4  (25)| 00:00:01 |
    |* 20 |              TABLE ACCESS BY INDEX ROWID                | TIBEX_HOLIDAYS                 |     1 |    13 |     2   (0)| 00:00:01 |
    |  21 |               INDEX FULL SCAN                           | XPKTIBEX_HOLIDAYS              |    83 |       |     1   (0)| 00:00:01 |
    |* 22 |              SORT JOIN                                  |                                |   402 |  2412 |     2  (50)| 00:00:01 |
    |  23 |               INDEX FULL SCAN                           | XPKTIBEX_HOLIDAYTRADINGCYCLEMA |   402 |  2412 |     1   (0)| 00:00:01 |
    |  24 |             TABLE ACCESS BY INDEX ROWID                 | TIBEX_TRADINGCYCLE             |     2 |    26 |     2   (0)| 00:00:01 |
    |* 25 |              INDEX RANGE SCAN                           | XAK1TIBEX_TRADINGCYCLE         |     2 |       |     1   (0)| 00:00:01 |
    |  26 |          VIEW                                           | index$_join$_024               |    80 |  1760 |     3  (34)| 00:00:01 |
    |* 27 |           HASH JOIN                                     |                                |       |       |            |          |
    |  28 |            INDEX FAST FULL SCAN                         | XAK1TIBEX_TRADINGCYCLE         |    80 |  1760 |     1   (0)| 00:00:01 |
    |  29 |            INDEX FAST FULL SCAN                         | XPKTIBEX_TRADINGCYCLE          |    80 |  1760 |     1   (0)| 00:00:01 |
    |  30 |         TABLE ACCESS FULL                               | TIBEX_CYCLEPERIODMAP           |   275 |  4950 |     5   (0)| 00:00:01 |
    |  31 |        TABLE ACCESS BY INDEX ROWID                      | TIBEX_CYCLEPERIODMAPOVER       |     1 |    47 |     0   (0)| 00:00:01 |
    |* 32 |         INDEX UNIQUE SCAN                               | XPKTIBEX_CYCLEPERIODMAPOVER    |     1 |       |     0   (0)| 00:00:01 |
    |  33 |       TABLE ACCESS FULL                                 | TIBEX_TRADINGPERIOD            |   330 | 13860 |     7   (0)| 00:00:01 |
    |  34 |    LOAD AS SELECT                                       | SYS_TEMP_0FD9D662C_FB42A6E1    |       |       |            |          |
    |  35 |     NESTED LOOPS                                        |                                |     1 |   282 |    98   (5)| 00:00:02 |
    |* 36 |      FILTER                                             |                                |       |       |            |          |
    |  37 |       NESTED LOOPS OUTER                                |                                |     1 |   278 |    98   (5)| 00:00:02 |
    |  38 |        NESTED LOOPS                                     |                                |     1 |   267 |    97   (5)| 00:00:02 |
    |  39 |         MERGE JOIN CARTESIAN                            |                                |     1 |   254 |    96   (5)| 00:00:02 |
    |  40 |          NESTED LOOPS                                   |                                |       |       |            |          |
    |  41 |           NESTED LOOPS                                  |                                |     1 |   247 |    95   (5)| 00:00:02 |
    |  42 |            NESTED LOOPS                                 |                                |     1 |   233 |    94   (5)| 00:00:02 |
    |  43 |             NESTED LOOPS                                |                                |     3 |   390 |    24  (17)| 00:00:01 |
    |* 44 |              HASH JOIN                                  |                                |     1 |   116 |    23  (18)| 00:00:01 |
    |  45 |               NESTED LOOPS                              |                                |     1 |    95 |    21  (20)| 00:00:01 |
    |  46 |                NESTED LOOPS OUTER                       |                                |    31 |  2821 |    21  (20)| 00:00:01 |
    |  47 |                 NESTED LOOPS                            |                                |    31 |  1364 |    21  (20)| 00:00:01 |
    |  48 |                  VIEW                                   | VW_NSO_1                       |     1 |    26 |    18  (17)| 00:00:01 |
    |  49 |                   SORT GROUP BY                         |                                |     1 |   113 |    18  (17)| 00:00:01 |
    |  50 |                    NESTED LOOPS ANTI                    |                                |     1 |   113 |    17  (12)| 00:00:01 |
    |  51 |                     NESTED LOOPS                        |                                |     1 |    99 |    16  (13)| 00:00:01 |
    |  52 |                      NESTED LOOPS OUTER                 |                                |     1 |    92 |    15  (14)| 00:00:01 |
    |* 53 |                       HASH JOIN                         |                                |     1 |    53 |    15  (14)| 00:00:01 |
    |* 54 |                        HASH JOIN                        |                                |     8 |   336 |     9  (12)| 00:00:01 |
    |  55 |                         NESTED LOOPS                    |                                |    40 |  1400 |     7  (15)| 00:00:01 |
    |  56 |                          NESTED LOOPS OUTER             |                                |    40 |  1240 |     7  (15)| 00:00:01 |
    |* 57 |                           HASH JOIN                     |                                |    40 |   800 |     4  (25)| 00:00:01 |
    |* 58 |                            INDEX RANGE SCAN             | XPKTIBEX_DAYSTRADINGCYCLEMAP   |    40 |   280 |     1   (0)| 00:00:01 |
    |  59 |                            VIEW                         | index$_join$_044               |    80 |  1040 |     3  (34)| 00:00:01 |
    |* 60 |                             HASH JOIN                   |                                |       |       |            |          |
    |  61 |                              INDEX FAST FULL SCAN       | XAK1TIBEX_TRADINGCYCLE         |    80 |  1040 |     1   (0)| 00:00:01 |
    |  62 |                              INDEX FAST FULL SCAN       | XPKTIBEX_TRADINGCYCLE          |    80 |  1040 |     1   (0)| 00:00:01 |
    |  63 |                           VIEW PUSHED PREDICATE         |                                |     1 |    11 |     1   (0)| 00:00:01 |
    |* 64 |                            HASH JOIN                    |                                |     1 |    32 |     7  (29)| 00:00:01 |
    |  65 |                             MERGE JOIN                  |                                |     3 |    57 |     4  (25)| 00:00:01 |
    |* 66 |                              TABLE ACCESS BY INDEX ROWID| TIBEX_HOLIDAYS                 |     1 |    13 |     2   (0)| 00:00:01 |
    |  67 |                               INDEX FULL SCAN           | XPKTIBEX_HOLIDAYS              |    83 |       |     1   (0)| 00:00:01 |
    |* 68 |                              SORT JOIN                  |                                |   402 |  2412 |     2  (50)| 00:00:01 |
    |  69 |                               INDEX FULL SCAN           | XPKTIBEX_HOLIDAYTRADINGCYCLEMA |   402 |  2412 |     1   (0)| 00:00:01 |
    |  70 |                             TABLE ACCESS BY INDEX ROWID | TIBEX_TRADINGCYCLE             |     2 |    26 |     2   (0)| 00:00:01 |
    |* 71 |                              INDEX RANGE SCAN           | XAK1TIBEX_TRADINGCYCLE         |     2 |       |     1   (0)| 00:00:01 |
    |* 72 |                          INDEX UNIQUE SCAN              | XPKTIBEX_TRADINGCYCLE          |     1 |     4 |     0   (0)| 00:00:01 |
    |  73 |                         VIEW                            |                                |    16 |   112 |     2   (0)| 00:00:01 |
    |  74 |                          TABLE ACCESS FULL              | SYS_TEMP_0FD9D662B_FB42A6E1    |    16 |  1216 |     2   (0)| 00:00:01 |
    |  75 |                        TABLE ACCESS FULL                | TIBEX_CYCLEPERIODMAP           |   275 |  3025 |     5   (0)| 00:00:01 |
    |  76 |                       TABLE ACCESS BY INDEX ROWID       | TIBEX_CYCLEPERIODMAPOVER       |     1 |    39 |     0   (0)| 00:00:01 |
    |* 77 |                        INDEX UNIQUE SCAN                | XPKTIBEX_CYCLEPERIODMAPOVER    |     1 |       |     0   (0)| 00:00:01 |
    |  78 |                      TABLE ACCESS BY INDEX ROWID        | TIBEX_TRADINGPERIOD            |     1 |     7 |     1   (0)| 00:00:01 |
    |* 79 |                       INDEX UNIQUE SCAN                 | XPKTIBEX_TRADINGPERIOD         |     1 |       |     0   (0)| 00:00:01 |
    |* 80 |                     TABLE ACCESS BY INDEX ROWID         | TIBEX_TRADINGMETHODENUM        |     1 |    14 |     1   (0)| 00:00:01 |
    |* 81 |                      INDEX UNIQUE SCAN                  | XPKTIBEX_TRADINGMETHODENUM     |     1 |       |     0   (0)| 00:00:01 |
    |  82 |                  TABLE ACCESS BY INDEX ROWID            | TIBEX_CYCLEPERIODMAP           |    31 |   558 |     2   (0)| 00:00:01 |
    |* 83 |                   INDEX SKIP SCAN                       | XPKTIBEX_CYCLEPERIODMAP        |    31 |       |     1   (0)| 00:00:01 |
    |  84 |                 TABLE ACCESS BY INDEX ROWID             | TIBEX_CYCLEPERIODMAPOVER       |     1 |    47 |     0   (0)| 00:00:01 |
    |* 85 |                  INDEX UNIQUE SCAN                      | XPKTIBEX_CYCLEPERIODMAPOVER    |     1 |       |     0   (0)| 00:00:01 |
    |* 86 |                INDEX UNIQUE SCAN                        | XPKTIBEX_TRADINGCYCLE          |     1 |     4 |     0   (0)| 00:00:01 |
    |  87 |               VIEW                                      |                                |    16 |   336 |     2   (0)| 00:00:01 |
    |  88 |                TABLE ACCESS FULL                        | SYS_TEMP_0FD9D662B_FB42A6E1    |    16 |  1216 |     2   (0)| 00:00:01 |
    |* 89 |              INDEX RANGE SCAN                           | XPKTIBEX_INSTRUMENTBOARDMAP    |    36 |   504 |     1   (0)| 00:00:01 |
    |* 90 |             TABLE ACCESS BY INDEX ROWID                 | TIBEX_INSTRUMENTADMIN          |     1 |   103 |    27   (0)| 00:00:01 |
    |* 91 |              INDEX RANGE SCAN                           | SYS_C001331991                 |    35 |       |     1   (0)| 00:00:01 |
    |* 92 |            INDEX UNIQUE SCAN                            | XPKTIBEX_INSTRACTIONENUM       |     1 |       |     0   (0)| 00:00:01 |
    |* 93 |           TABLE ACCESS BY INDEX ROWID                   | TIBEX_INSTRACTIONENUM          |     1 |    14 |     1   (0)| 00:00:01 |
    |  94 |          BUFFER SORT                                    |                                |    40 |   280 |    95   (5)| 00:00:02 |
    |* 95 |           INDEX RANGE SCAN                              | XPKTIBEX_DAYSTRADINGCYCLEMAP   |    40 |   280 |     1   (0)| 00:00:01 |
    |  96 |         TABLE ACCESS BY INDEX ROWID                     | TIBEX_TRADINGCYCLE             |     1 |    13 |     1   (0)| 00:00:01 |
    |* 97 |          INDEX UNIQUE SCAN                              | XPKTIBEX_TRADINGCYCLE          |     1 |       |     0   (0)| 00:00:01 |
    |  98 |        VIEW PUSHED PREDICATE                            |                                |     1 |    11 |     1   (0)| 00:00:01 |
    |* 99 |         HASH JOIN                                       |                                |     1 |    32 |     7  (29)| 00:00:01 |
    | 100 |          MERGE JOIN                                     |                                |     3 |    57 |     4  (25)| 00:00:01 |
    |*101 |           TABLE ACCESS BY INDEX ROWID                   | TIBEX_HOLIDAYS                 |     1 |    13 |     2   (0)| 00:00:01 |
    | 102 |            INDEX FULL SCAN                              | XPKTIBEX_HOLIDAYS              |    83 |       |     1   (0)| 00:00:01 |
    |*103 |           SORT JOIN                                     |                                |   402 |  2412 |     2  (50)| 00:00:01 |
    | 104 |            INDEX FULL SCAN                              | XPKTIBEX_HOLIDAYTRADINGCYCLEMA |   402 |  2412 |     1   (0)| 00:00:01 |
    | 105 |          TABLE ACCESS BY INDEX ROWID                    | TIBEX_TRADINGCYCLE             |     2 |    26 |     2   (0)| 00:00:01 |
    |*106 |           INDEX RANGE SCAN                              | XAK1TIBEX_TRADINGCYCLE         |     2 |       |     1   (0)| 00:00:01 |
    |*107 |      INDEX UNIQUE SCAN                                  | XPKTIBEX_TRADINGPERIOD         |     1 |     4 |     0   (0)| 00:00:01 |
    |*108 |    HASH JOIN SEMI                                       |                                |     1 |   331 |     6  (34)| 00:00:01 |
    |*109 |     VIEW                                                |                                |     2 |   582 |     2   (0)| 00:00:01 |
    | 110 |      TABLE ACCESS FULL                                  | SYS_TEMP_0FD9D662C_FB42A6E1    |     2 |   272 |     2   (0)| 00:00:01 |
    | 111 |     VIEW                                                | VW_NSO_2                       |     2 |    80 |     3  (34)| 00:00:01 |
    | 112 |      HASH GROUP BY                                      |                                |     2 |    38 |     3  (34)| 00:00:01 |
    | 113 |       VIEW                                              |                                |     2 |    38 |     2   (0)| 00:00:01 |
    | 114 |        TABLE ACCESS FULL                                | SYS_TEMP_0FD9D662C_FB42A6E1    |     2 |   272 |     2   (0)| 00:00:01 |
    ------------------------------------------------------------------------------------------------------------------------------------------

  • How to get this sql query value in oracle query?

    Hi all,
    i am using one query in sql that is
    select @EarlyLeaversMin = DATEDIFF(Minute,@OutTime,@nshiftmax)
    suppose first line query is getting 60 minutes.
    select @EarlyLeaversMin1=DATEDIFF(Minute,@temphrs,@ShiftTime)
    second line query is also getting 60 minutes
    set @EarlyLeaversMin=@EarlyLeaversMin+@EarlyLeaversMin1+1
    and now here it's calculating both variable minutes and storing in @earlyleaversmin that should store like 60+60+1=121 mintes
    select @EarlyLeaverstimeformat = CONVERT(char(8),Dateadd(n,@EarlyLeaversMin,0),108)
    so now it will store in this query that value in this format : 01:21:00
    can i use the same which it's happening here??
    thanks

    Oracle handles dates and time very differently from SQL Server (as I gather others on this forum have already tried to explain to you).
    Anyway, Oracle does not have a TIME datetype, but what it does have are INTERVALs. In this case you would use INTERVAL DAY TO SECOND. It's not completely clear what you mean by "store in this query that value" but we can use INTERVALS as both table columns and PL/SQL variables.
    So your first query would be something like this:
    declare
        interval_var  INTERVAL DAY TO SECOND;
    begin
         select (nshiftmax - outtime) day to second
         into interval_var
         from whatever;We can do arithmetic with interval variables.
         select (nshiftmax - outtime) day to second +  (shifttime - temphrs) day to second
         into interval_var
         from whatever;To add a hard-coded interval such as 1 minute you can use this functionality:
         interval_var := interval_var + to_dsinterval('0 0:1:0');There's loads of info in the Oracle documentation. [url http://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements001.htm#sthref115]Find out more.
    Cheers, APC

  • How do i see query EXECUTION PLAN

    Dear Experts ,
    I'm using Toad, PL/SQL developer and working on very big query but its response is very slow could u please guide any one HOW I SEE EXECUTION PLAN of query to optimize further.
    Faheem Latif
    NetSol Technologies Limited Pakistan.
    www.netsoltek.com, www.leasesoft.biz

    Dear ,
    Thank's for reply but it is showing this error.
    "ORA-02404: specified plan table not found"
    Faheem Latif
    NetSol Technologies Limited Pakistan.
    www.netsoltek.com, www.leasesoft.biz

  • Exact time of SQL query execution.

    Hi,
    Is there any way to get the exact time of execution of particular SQL query.
    Oracle Version : 10.2.0.4.0
    OS : Sun OS.
    Thx,
    Gowin.

    In general it's pretty hard.
    Look at V$SQLSTAT.ELAPSED_TIME and DBA_HIST_SQLSTAT.ELAPSED_TIME_TOTAL/DELTA (need a license).
    It will give you accurate results for a non-parallel query. For parallel queries you'll get a total time spent by all slaves.
    Also you can enable tracing either on database or session level and analyze the trace files generated.
    Edited by: Max Seleznev on Nov 4, 2011 12:06 PM

  • SQL Query to detect Oracle version

    Hello,
    For our application, we need to programmatically detect the version of the Oracle instance. Can someone please tell me if there is any SQL query I can run to get the version information?
    Thank you in advance for enlightening me.
    Pradeep

    hi,
    SQL> select substr(banner,instr(banner,'Release')+8,instr(banner,' - ')-instr(banner,'Release')-8) from v$version where banner like 'Oracle%';
    SUBSTR(BANNER,INSTR(BANNER,'RELEASE')+8,INSTR(BANNER,'-')-INSTR(
    7.3.4.5.0
    SQL> conn scott/tiger@lsc65
    Connected.
    SQL> select substr(banner,instr(banner,'Release')+8,instr(banner,' - ')-instr(banner,'Release')-8) from v$version where banner like 'Oracle%';
    SUBSTR(BANNER,INSTR(BANNER,'RELEASE')+8,INSTR(BANNER,'-')-INSTR(
    8.1.7.4.0
    SQL> conn scott/tiger@lsc67
    Connected.
    SQL> select substr(banner,instr(banner,'Release')+8,instr(banner,' - ')-instr(banner,'Release')-8) from v$version where banner like 'Oracle%';
    SUBSTR(BANNER,INSTR(BANNER,'RELEASE')+8,INSTR(BANNER,'-')-INSTR(
    9.2.0.6.0
    SQL> conn scott/tiger@lsc68
    Connected.
    SQL> select substr(banner,instr(banner,'Release')+8,instr(banner,' - ')-instr(banner,'Release')-8) from v$version where banner like 'Oracle%';
    SUBSTR(BANNER,INSTR(BANNER,'RELEASE')+8,INSTR(BANNER,'-')-INSTR(
    10.1.0.3.0
    SQL> HTH
    Laurent Schneider
    OCM DBA

  • SQL Query on Planning Repository

    Hi all,
    Let's say that I have an Entity Hierarchy as follows:
    - Entity
    + E1
    + E2
    + E3
    E31
    E32
    + E4
    E41
    E42
    + E5
    E6
    E7
    + E8
    E31 (Shared)
    and we have access control set at group level:
    - G1 has write access to Idesc(E1)
    - G2 has write access to Idesc(E2)
    - G3 has write access to Idesc(E3)
    - G4 has write access to Idesc(E4)
    - G5 has write access to Idesc(E5)
    - G8 has write access to Idesc(E8)
    I have one user U2 who belongs to G2.
    How could I build a SQL query to determine if U2 has access to Base Entity E31?
    I have taken a look to http://camerons-blog-for-essbase-hackers.blogspot.nl/2011/10/stupid-planning-queries-6-security.html
    although we would have to check if the base entity belongs to any of the entities where U2 has access.
    Thanks for any help.

    I believe it's commonly known that it's case sensitive. e.g. it's documented here:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=using_recordsets_7.html
    "Unlike the rest of ColdFusion, Query of Queries is case-sensitive. However, Query of Queries supports two string functions, UPPER() and LOWER(), which you can use to achieve case-insensitive matching."

  • SQL query (Windows) to Oracle (Linux)

    Hi,
    I have an Oracle on Linux, it is an Oracle XE. From Windows 7, I would like to access this Oracle Linux using any SQL query software. So, to do it, I would like to know:
    1) which components do I need to install ?
    2) how can I setup the components or the operating system or Oracle?
    4) where I can download the components? and what would be the name of the components?
    4) which SQL software I can run on Windows  to access Linux directly using the components or some settings on this software?
    5) are there any software that it is free to download?
    tks.

    ac01e371-bc09-4b23-81d2-b251ca9edd1e wrote:
    Hi,
    I have an Oracle on Linux, it is an Oracle XE. From Windows 7, I would like to access this Oracle Linux using any SQL query software. So, to do it, I would like to know:
    1) which components do I need to install ?
    2) how can I setup the components or the operating system or Oracle?
    4) where I can download the components? and what would be the name of the components?
    4) which SQL software I can run on Windows  to access Linux directly using the components or some settings on this software?
    5) are there any software that it is free to download?
    tks.
    Oracle SQL Developer Downloads</title><meta name="Title" content="Oracle SQL Developer Downloads…
    SQuirreL SQL Client Home Page</title></head><body><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 …

  • Excel ADODB Sql Query Execution taking hours when manipulate excel tables

    Hello All 
    I have 28000 records with 8 column in an sheet. When I convert the sheet into ADODB database and copy to new
    excel using below code it is executing in less than a min
    Set Tables_conn_obj = New ADODB.Connection
    Tables_conn_str = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Table_Filename & ";Extended Properties=""Excel 12.0;ReadOnly=False;HDR = Yes;IMEX=1"""
    Tables_conn_obj.Open Tables_conn_str
    First_Temp_sqlqry = "Select * INTO [Excel 12.0;DATABASE=C:\Prod Validation\Database\Second Acat Table.xlsb].[Sheet1] Table [first - Table$];" Tables_conn_obj.Execute First_Temp_sqlqry
    But when I change the query to manipulate one column in current table based on another table in the same excel
    and try to copy the results in another excel, it is taking more than one hour.. why it is taking this much time when both the query results returns the same number of rows and column. I almost spend one week and still not able to resolve this issue.
    Even I tried copyfromrecordset, getrows(), getstring(), Looping each recordset fields options all of them taking
    same amount of time. Why there is huge difference in execution time.
    Important note: Without into statement even below query is executing in few seconds.
    select ( ''''''manipulating first column based on other table data''''''''''''''
    iif(
    [Second - Table$].[Policy Agent] = (select max([ACAT$].[new_Agent_number]) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] > '2014-10-01') ) , (select max([ACAT$].[Old_Agent_number]) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] > '2014-10-01')) ,
    iif( [Second - Table$].[Policy Agent] = (select max([ACAT$].[Old_Agent_number]) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$]where [ACA T$].[Old_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] <= '2014-10-01') ), (select max([ACAT$].[new_Agent_number]) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] <= '2014-10-01')) ,
    [Second - Table$].[Policy Agent] ))) as [Policy Agent],
    ''''''summing up all other columns''''''''''''''
    (iif(isnull(sum([Second - Table$].[Auto BW-Line Of Business Detail])),0,sum([Second - Table$].[Auto BW-Line Of Business Detail]))) as [Auto BW-Line Of Business Detail],(iif(isnull(sum([Second - Table$].[Auto Farmers])),0,sum([Second - Table$].[Auto Farmers]))) as [Auto Farmers],(iif(isnull(sum([Second - Table$].[MCA])),0,sum([Second - Table$].[MCA]))) as [MCA],(iif(isnull(sum([Second - Table$].[CEA])),0,sum([Second - Table$].[CEA]))) as [CEA],(iif(isnull(sum([Second - Table$].[Commercial P&C])),0,sum([Second - Table$].[Commercial P&C]))) as [Commercial P&C],(iif(isnull(sum([Second - Table$].[Comm WC])),0,sum([Second - Table$].[Comm WC]))) as [Comm WC],(iif(isnull(sum([Second - Table$].[Fire Farmers])),0,sum([Second - Table$].[Fire Farmers]))) as [Fire Farmers],(iif(isnull(sum([Second - Table$].[Flood])),0,sum([Second - Table$].[Flood]))) as [Flood],(iif(isnull(sum([Second - Table$].[Kraft Lake])),0,sum([Second - Table$].[Kraft Lake]))) as [Kraft Lake],(iif(isnull(sum([Second - Table$].[Life])),0,sum([Second - Table$].[Life]))) as [Life],(iif(isnull(sum([Second - Table$].[Foremost])),0,sum([Second - Table$].[Foremost]))) as [Foremost],(iif(isnull(sum([Second - Table$].[Umbrella])),0,sum([Second - Table$].[Umbrella]))) as [Umbrella],(iif(isnull(sum([Second - Table$].[MCNA])),0,sum([Second - Table$].[MCNA]))) as [MCNA]
    INTO [Excel 12.0;DATABASE=C:\Prod Validation\Database\Second Acat Table.xlsb].[Sheet1]
    from [Second - Table$] group by [Second - Table$].[Policy Agent] ;

    Hi Fei,
      Thank you so much for the reply post. I just executed the same above SQL without INTO Statement and assigned the SQL result to ADODB recordset as below. If the time difference is due to the SQL query then below statements also should execute for hours
    right, but it gets executed in seconds. But to copy the recordset to excel again it is taking hours. I tried copyfromrecordset,
    getrows(), getstring(), Looping each recordset fields options and all of them taking same amount of time. Please let me know there is delay in time for this much small data
    Even I tried to typecast all columns to double, string in SQL and still the execution time  is not reduced. 
    First_Temp_Recordset.Open sql_qry, Tables_conn_obj, adOpenStatic, adLockOptimistic ''' OR SET First_Temp_Recordset = Tables_conn_obj.Execute sql_qry

  • Excel ADODB Sql Query Execution taking hours when manipulate excel tables why?

    I have 28000 records with 8 column in an sheet. When I convert the sheet into ADODB database and copy to new excel using below code it is executing in less than a min
    Set Tables_conn_obj = New ADODB.Connection Tables_conn_str = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Table_Filename & ";Extended Properties=""Excel 12.0;ReadOnly=False;HDR = Yes;IMEX=1""" Tables_conn_obj.Open
    Tables_conn_str First_Temp_sqlqry = "Select * INTO [Excel 12.0;DATABASE=C:\Prod Validation\Database\Second Acat Table.xlsb].[Sheet1] Table [first - Table$];" Tables_conn_obj.Execute First_Temp_sqlqry
    But when I change the query to manipulate one column in current table based on another table in the same excel and try to copy the results in another excel, it is taking more than one hour.. why it is taking this much time when both the query results returns
    the same number of rows and column. I almost spend one week and still not able to resolve this issue.
    Even I tried copyfromrecordset, getrows(), getstring(), Looping each recordset fields options all of them taking same amount of time. Appreciate any inputs...
    select ( ''''''manipulating first column based on other table data''''''''''''''
    iif( [Second - Table$].[Policy Agent] = (select max([ACAT$].[new_Agent_number]) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where
    [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] > '2014-10-01') ) , (select max([ACAT$].[Old_Agent_number]) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate]
    = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] > '2014-10-01')) ,
    iif( [Second - Table$].[Policy Agent] = (select max([ACAT$].[Old_Agent_number]) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$]where
    [ACA T$].[Old_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] <= '2014-10-01') ), (select max([ACAT$].[new_Agent_number]) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate]
    = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] <= '2014-10-01')) ,
    [Second - Table$].[Policy Agent] ))) as [Policy Agent],
    ''''''summing up all other columns''''''''''''''
    (iif(isnull(sum([Second - Table$].[Auto BW-Line Of Business Detail])),0,sum([Second - Table$].[Auto BW-Line Of Business Detail]))) as [Auto BW-Line Of Business Detail],(iif(isnull(sum([Second - Table$].[Auto Farmers])),0,sum([Second - Table$].[Auto Farmers])))
    as [Auto Farmers],(iif(isnull(sum([Second - Table$].[MCA])),0,sum([Second - Table$].[MCA]))) as [MCA],(iif(isnull(sum([Second - Table$].[CEA])),0,sum([Second - Table$].[CEA]))) as [CEA],(iif(isnull(sum([Second - Table$].[Commercial P&C])),0,sum([Second
    - Table$].[Commercial P&C]))) as [Commercial P&C],(iif(isnull(sum([Second - Table$].[Comm WC])),0,sum([Second - Table$].[Comm WC]))) as [Comm WC],(iif(isnull(sum([Second - Table$].[Fire Farmers])),0,sum([Second - Table$].[Fire Farmers]))) as [Fire
    Farmers],(iif(isnull(sum([Second - Table$].[Flood])),0,sum([Second - Table$].[Flood]))) as [Flood],(iif(isnull(sum([Second - Table$].[Kraft Lake])),0,sum([Second - Table$].[Kraft Lake]))) as [Kraft Lake],(iif(isnull(sum([Second - Table$].[Life])),0,sum([Second
    - Table$].[Life]))) as [Life],(iif(isnull(sum([Second - Table$].[Foremost])),0,sum([Second - Table$].[Foremost]))) as [Foremost],(iif(isnull(sum([Second - Table$].[Umbrella])),0,sum([Second - Table$].[Umbrella]))) as [Umbrella],(iif(isnull(sum([Second - Table$].[MCNA])),0,sum([Second
    - Table$].[MCNA]))) as [MCNA]
    INTO [Excel 12.0;DATABASE=C:\Prod Validation\Database\Second Acat Table.xlsb].[Sheet1]
    from [Second - Table$] group by [Second - Table$].[Policy Agent] ;

    Hi Fei,
      Thank you so much for the reply post. I just executed the same above SQL without INTO Statement and assigned the SQL result to ADODB recordset as below. If the time difference is due to the SQL query then below statements also should execute for hours
    right, but it gets executed in seconds. But to copy the recordset to excel again it is taking hours. I tried copyfromrecordset,
    getrows(), getstring(), Looping each recordset fields options and all of them taking same amount of time. Please let me know there is delay in time for this much small data
    Even I tried to typecast all columns to double, string in SQL and still the execution time  is not reduced. 
    First_Temp_Recordset.Open sql_qry, Tables_conn_obj, adOpenStatic, adLockOptimistic ''' OR SET First_Temp_Recordset = Tables_conn_obj.Execute sql_qry

  • SQL query execution Issue

    Hi,
    Facing Database performance issue while runing overnight batches.
    Generate tfprof output for that batch and found some sql query which is having high elapsed time. Could any one please let me know what is the issue for this. It will also be great help if anyone suggest what need to be done as per tuning of this sql queries so as to get better responce time.
    Waiting for your reply.
    Effected SQL List:
    INSERT INTO INVTRNEE (TRANS_SESSION, TRANS_SEQUENCE, TRANS_ORG_CHILD,
    TRANS_PRD_CHILD, TRANS_TRN_CODE, TRANS_TYPE_CODE, TRANS_DATE, INV_MRPT_CODE,
    INV_DRPT_CODE, TRANS_CURR_CODE, PROC_SOURCE, TRANS_REF, TRANS_REF2,
    TRANS_QTY, TRANS_RETL, TRANS_COST, TRANS_VAT, TRANS_POS_EXT_TOTAL,
    INNER_PK_TECH_KEY, TRANS_INNERS, TRANS_EACHES, TRANS_UOM, TRANS_WEIGHT,
    TRANS_WEIGHT_UOM )
    VALUES
    (:B22 , :B1 , :B2 , :B3 , :B4 , :B5 , :B21 , :B6 , :B7 , :B8 , :B20 , :B19 ,
    NULL, :B9 , :B10 , :B11 , 0.0, :B12 , :B13 , :B14 , :B15 , :B16 , :B17 ,
    :B18 )
    call count cpu elapsed disk query current rows
    Parse 722 0.09 0.04 0 0 0 0
    Execute 1060 7.96 83.01 11442 21598 88401 149973
    Fetch 0 0.00 0.00 0 0 0 0
    total 1782 8.05 83.06 11442 21598 88401 149973
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    UPDATE /*+ ROWID(TRFDTLEE) */TRFDTLEE SET TRF_STATUS = :B2
    WHERE
    ROWID = :B1
    call count cpu elapsed disk query current rows
    Parse 635 0.03 0.01 0 0 0 0
    Execute 49902 14.48 271.25 41803 80704 355837 49902
    Fetch 0 0.00 0.00 0 0 0 0
    total 50537 14.51 271.27 41803 80704 355837 49902
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    DECLARE
    var_trans_session     invtrnee.trans_session%TYPE;
    BEGIN
    -- ADDED BY SHANKAR ON 08/29/97
    -- GET THE NEXT AVAILABLE TRANS_SESSION
    bastkey('trans_session',0,var_trans_session,'T');
    -- MAS001
    uk_trfbapuo_auto(var_trans_session,'UPLOAD','T',300);
    -- MAS001 end
    END;
    call count cpu elapsed disk query current rows
    Parse 0 0.00 0.00 0 0 0 0
    Execute 1 24191.23 24028.57 8172196 10533885 187888 1
    Fetch 0 0.00 0.00 0 0 0 0
    total 1 24191.23 24028.57 8172196 10533885 187888 1
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer goal: CHOOSE
    SELECT INNER_PK_TECH_KEY
    FROM
    PRDPCDEE WHERE PRD_LVL_CHILD = :B1 AND LOOSE_PACK_FLAG = 'T'
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.00 0 0 0 0
    Execute 56081 1.90 2.03 0 0 0 0
    Fetch 56081 11.07 458.58 53792 246017 0 56081
    total 112163 12.98 460.61 53792 246017 0 56081
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    ******************

    First off, be aware of the assumptions I'm making. The SQL you presented above strongly suggests (to me at least) that you have cursor for loops. If that's the case, you need to review what their purpose is and look to convert them into single statement DML commands. For example if you have something like this
    DECLARE
        ln_Count        NUMBER;
        ln_SomeValue    NUMBER;
    BEGIN
        FOR lcr_Row IN (    SELECT pk_id,col1,col2 FROM some_table)
        LOOP
            SELECT
                COUNT(*)
            INTO
                ln_COunt
            FROM
                target_table
            WHERE
                pk_id = lcr_Row.pk_id;
            IF ln_Count = 0 THEN
                SELECT
                    some_value
                INTO
                    ln_SomeValue
                FROM
                    some_other_table
                WHERE
                    pk_id = lcr_Row.col1
                INSERT
                INTO
                    target_table
                    (   pk_id,
                        some_other_value,
                        col2
                VALUES
                    (   lcr_Row.col1,
                        ln_SomeValue,
                        lcr_Row.col2
            ELSE
                UPDATE
                    target_table
                SET
                    some_other_value = ln_SomeValue
                WHERE
                    pk_id = lcr_Row.col1;
            END IF;
        END LOOP;
    END;                            it could be rewritten as
    DECLARE
    BEGIN
        MERGE INTO target_table b
        USING ( SELECT
                    a.pk_id,
                    a.col2,
                    b.some_value
                FROM
                    some_table a,
                    some_other_table b
                WHERE
                    b.pk_id = a.col1
               ) e
        ON (b.pk_id = e.pk_id)
        WHEN MATCHED THEN
          UPDATE SET b.some_other_value = e.some_value
        WHEN NOT MATCHED THEN
          INSERT (  b.pk_id,
                    b.col2,
                    b.some_other_value)
          VALUES(   b.pk_id,
                    b.col2,
                    b.some_value);
    END;It's going to take a bit of analysis and work but the fastest and most scalable way to approach processing data is to use SQL rather than PL/SQL. PL/SQL data processing i.e. cursor loops should be an option of last resort.
    HTH
    David

  • SQL query execution in DB02 hangs if record set is more than 50000

    Hi,
    We are facing issue in a report performance. The return is using native SQL query.
    There are custom views created ar database level for pricing/maetrial and stock. The native sql query is written on these views. The report takes around 15 mins to run in background .
    We are trying to analyse the native SQL query through DB02. I tried fetching records for one particular
    custom view to make out if its indexing issue or something else.When i using TOP 35000 records with select query runs fine with this dataset or less than this . If i increase it to 40000 system doesn;t show anything in SQL ouptut. And above one lakh records system gives timeout.
    The count in this view gives some 10 lakh records which I don't feel is v.v.huge that query that too native sql takes so much time.
    Any help on this will be highly appreciated.
    Regards
    Madhu

    what do you expect from that poor information.
    do you change data or onyl select.
    If you use SAP and ABAP, then you should also use Open SQL.
    Otherwise it is possible to run the SQL Trace with Native SQL, it is anyway only Native SQL, what the trace sees.
    Use package size and it will probably work fine.
    Siegfried

  • Sql query execution in jsp

    can u help me to print multiple rows resulted from a sql query using jsp.

    Map the ResultSet to a Collection of DTO's, use the JSTL's c:forEach tag to iterate through it inside a JSP page, use the HTML table, tr and td elements to present the data in a table.

Maybe you are looking for

  • Adapter that used to work with Gen 1 no longer works with Gen 6 nano

    Hi Here's my problem I had nano gen 1 2Gb I had no use for (a gift) and now I I restore radios I git to use it to trasmit music via adapter I have bought 2 weeks ago, which plugs into the Apple interface slot and outputs USB and L/R audio. This one.

  • My itunes wont work for my itouch

    i just got a new computer for christmas, and my old one crashed, so i got a software that took all my songs off my ipod and saved them to my computer, i installed itunes and when i plugged it in it would not reconize it as my itouches main computer,

  • Movement Type & Excise Register

    Hi Experts ! Is there any configuration between movement type & Excise Register, where do we define Excise Register's receipt / issue indicator for movement type I want to define movement type 161 in RG23A Part I Issue side, at present with the exist

  • Cannot Access Certain Websites from MBP

    I've tried setting DNS to 8.8.8.8 as well as connecting via Ethernet as well as with my wireless broadband dongle, and still no luck. In fact, when I connect my dongle my internet connection goes even worse and I can hardly load any websites at all!

  • How do I share a folder?

    Is there any way to share a specific folder with someone on my family sharing? If there is no way I would like to find the Apple equivalent of a suggestion box. This concept could be exceedingly useful.