a lot of the great process time table

Hello world
I have a problem with a process that calculates 6 columns in a table with 260 million lines. Initially, the computing time was about 1.2 minutes per line. which obviously takes more than a lifetime to the end (about 500 years).
To improve this process naturally so my first step was to the partition table. This create 64 partitions ranks 5 million in total. My second step was to use a big raise with a limit of 500,000 by block, in this way, I have my table and the next step is to calculate my columns. Unfortunately, my first 2 columns just take 2 hours to complete the 260 million (Note: I need to calculate all the rows in the table), but the rest of the columns, take 90% of total or even more. Finally, I make a big day with forall using data calculated on my paintings.
After all this, calculation time was reduced from 1.2 minutes by the line to 6 or 7 seconds per rank. time, which is great, but only reduced from 500 years to 49 years.
With this Setup, my next logical step is to parallelize my request, but if one have a degree of 8, my best shot is to take 6 years.
Now, four of the six columns, the problem is that I need to calculate some values which requires some avg and sum over from these last six months before recording data.
So, here's my real question. How I do it works?... surely I can't wait many years. the company is perhaps broken before this finish.
Who is the professional way to make this real? I think that there, businesses have tables with many more lines, or even billions, I saw in other forums.
I need this, somehow, somehow, it takes not more than one or two months... still less is even better. Help, please

My DB is a 11G, running on 64 bit. 32 GB of RAM, CPU Quad Core 6.

-Please explain what makes this request
Select nvl (avg (chargeable), 0), max (flactual), max (flanterior), max (lactual), max (lanterior)
in v_facturable_ant, v_flactual_ant, v_flanterior_ant, v_lactual_ant, v_lanterior_ant
of mv_data_sec
where v_periodo (idx) period
and cod_empresa = v_cod_empresa (idx)
and id_cliente = v_id_cliente (idx)
and id_medidor = v_id_medidor_consulta
and flactual = (select max (flactual)
of mv_data_sec
where cod_empresa = v_cod_empresa (idx)
and id_cliente = id_cliente
and id_medidor = v_id_medidor_consulta
and v_periodo (idx) period
and flactual<>

1 v_flactual (idx)-online the value of an entry in the PL/SQL table
2 v_periodo (idx)-online key to score even a record in the PL/SQL table
3. the aggregate of all partitions except v_periodo (idx)
4 find the max (flactual) value is less than the value # 1 above
5 only where aggregate data flactual value = value # 4 above and
cod_empresa, id_cliente, id_medidor a recording in the PL/SQL table match

This is an aggregation for each record in each partition table
"where id_tipo_documento ('b', 'F').

The aggregation will include all the records with the largest value flactual which is
less than the record value of PL/SQL regardless of the value of id_tipo_documento.

So, if there are records with values of 5, 4, 3, 2 and 1 flactual

1 rec with value of 5 will include records that have a value of 4
2 rec with value 4 will include records that have a value of 3
3. rec with value 3 will include records that have a value of 2
4. rec with value of 2 will include records that have a value of 1

With the approach you use if there are 1,000 records with the same values, flactual, cod_empresa, id_cliente and id_medidor, your code will be
perform exactly the same aggregation on the other values (lactual, lanterior, flanterior, facurable) 1,000 times.

This suggests that you do what I suggested in a previous post as #2
>
2. create a separate query to roll up the data in the table to get the max and avg values, you want to use for the calculation and the update. This query can roll by 'cod_empresa', 'id_cliente' and 'id_medidor '. You can roll it for each period or for each 'anti period' (with period1, periode2 and period3 that the anti-periode periode2 includes all other periods - Yes period.1 & 3).
>
Something along the lines of

select periodo, cod_empresa, id_cliente, id_medidor,
count(facturable), sum(facturable), max(flactual), max(flanterior), max(lactual), max(lanterior)
from mv_data_sec
group by periodo, cod_empresa, id_cliente, id_medidor

and record the results in a new work table that is indexed appropriately. It doesn't once aggregations in advance.

Use this work table in your query above. You can now change the query or cursor to work with only one partition at a time by adding a WHERE clause with the partition key that is passed as a parameter to your procedure.

You may even be able to change the CURSOR to join the main table with the new table of work and iterate that, without needing to make a second request at all.

One thing. that I don't know. You eliminate aggregation online because you probably aggregate values several times according to the grouping of data.

I would still like to see a small set of sample data and the results of your calculations on it.

Tags: Database

Similar Questions

  • Reset time: each reboot the laptop, the exact time is displayed. Towards the end of the reboot process, time passes before 2 or 3 hours.

    The date still remains correct. In the summer, I recall is that time jumps before 2 hours; in the winter of 3 hours. I used this laptop in Arizona, which does not use DST. A clue?

    Hi Whitewind.If you left click on the time at the bottom right, it will bring up a menu. Select change the date and time. Click on it then go to the time of the internet on the tabs, then click on change settings. Uncheck synchronize with internet time. Set the right time and it should remain. It can be when windows has been implemented the incorrect time zone has been selected.

  • start the creation of time table

    I want to create following table through pl/sql block. Please help me on this...

    store table name in the variable v_monyear

    declare

    date of T_DATE;
    v_month varchar2 (10);
    v_year varchar2 (10);
    v_monyear varchar2 (100);
    number of v_cnt;

    Start

    Select (to_date(sysdate,'dd-mon-yy')-1) in double T_DATE;
    Select substr (v_date, 4, 3) in the double v_month;
    Select substr (v_date, 8, 2) in the double v_year;
    v_monyear: = v_month | "_TABLE_' | v_year;
    end;
    /

    Published by: user9970512 on July 25, 2009 11:20

    Maybe

    begin
      execute immediate 'create table ' || to_char(sysdate,'mon') || '_table_' || to_char(sysdate,'rr') || ' as select * from '||to_char(sysdate,'mon') || '_table_' || to_char(sysdate,'rr')||'@orcl';
    end;
    /
    
  • Cannot check iOS 9.3 during the upgrade process. When there is a good connection internet, says no internet. Tried more than 30 times, even after reboot. Any suggestions?

    Cannot check iOS 9.3 during the upgrade process. When there is a good connection internet, says no internet. Tried more than 30 times, even after reboot. Any suggestions?

    You chose the option in iTunes to download the firmware first and install it in a second time after that?

  • Date and time shows the process of judgment up to the date and time

    I am expierencing problems with my date and time

    as my date and time always shows the shutdown to same-time process

    This is another type of problem, with which I am unfamiliar as if it were a CMOS battery error then the Date and time reset default

    but in my case, it is capable of stalling but starts after the power of the PC and stops time when I turned off the PC

    Solved by changing the CMOS battery...

  • The validation process hung for a table only!

    Hi all

    There is a table contains 79 columns (with a cloumn CLOB) with about 100 000 record, sometimes a problem occurs only with this table (and only these days) when you attempt to insert, update, delete from this table, the validation process hung! Why? and how to solve? I can't say why this problem occurs.

    We renamed the table and re-create using EXPDP, IMPDP orders, re-create triggers on it and repeat grants thereon to the roles that the previous, this procedure has solved the problem for maybe one day only, but the problem returns!

    Notes:

    This table is on a table space users, otherwise I use DB Oracle 11 g R2

    > The question is: What does it mean the blocking locks? and why this problem occurs? and how to avoid it from happening again?

    Have you read this:

    https://docs.Oracle.com/CD/E18283_01/server.112/e16508/consist.htm

    For example, this part:

    Written in conflict read-committed Transactions

    In a read committed transaction, a write conflict occurs when the transaction attempts to change an update by a simultaneous uncommitted transaction line, sometimes called a blocking transaction.

    The read committed transaction awaits the transaction that blocks at the end and release his lock of line. The options are the following:

    -If the blocking transaction is cancelled, the pending transaction then proceeds to change the locked row previously as if the other transaction never existed.

    -If the blocking transaction is committed and frees its locks, then the transaction pending proceeds to update scheduled for the newly modified line.

    > Where can I find this log file please?

    For example:

    C:\app\oracle\diag\rdbms\oracle\orcl\trace\alert_orcl.log

    Kind regards

    Zlatko

  • After that effects 2015.3 takes a long time to open, left after the closing process running

    My AE 2015.3 takes very long time to start. He gets the message "Initializing MediaCore" on the splash screen and then hangs there for 1-3 minutes. It opens also a ton of "Adobe After Effects 2015.3" tasks in the Task Manager, leaving them running even after I quit the program.

    Here is what my task manager looks at this time (no AE running)

    AECrazy.jpg

    So far, what I've done:

    1 uninstalled all Adobe software, including Adobe CC Panel

    2 uninstalled all 3rd party plugins, scripts, and presets

    3. manually deleted all files from adobe - complete cleaning

    4. re-installed AE and some other programs

    (all with reboot between the two).

    No difference.

    Help?

    Apparently, nVidia GeForce drivers are at fault. The break of v368.81 WHQL way Adobe applications communicate with Media Core, make After Effects, first and slow speed Grade, leaving the additional processes in their wake and spoil some plugins 3rd party.

    Returning to a previous driver nVidia solved all the problems.

  • 14 Adobe photoshop elements requires registration at the start and then the process times out, say that there is no network connectivity

    When you try to start the program that a window pop up - registration required. The process of application certificate (implemented at least a dozen times). The process times out, say there is no network connectivity, which is a nonsense at least at my end. Same behavior applies for the first loose. I have the license keys for both products and they appear under my adobe account. However, because of the described behavior I can't use the products.

    Check your hosts file.

    help for that and other adobe.com sure common connection problems read, http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

  • Remove the length of time of the table of contents

    Hello

    I am using Captivate 4.

    We add TOC in our movies and want to remove the length of the table of contents, as shown below:

    time.gif

    I tried to uncheck the checkbox 'Show time' located in the 'skin TOC settings' dialogue, but it did not work.

    Can anyone help?

    Thank you

    Merav.

    Hello

    Do not insert it as a widget, but as an Animation (which is not very clear on the site of Michael). You can simply ignore the warning of _root. It works very well. Sorry I forgot to explain. You need to verify that your PC is AS2, however, it does not work in AS3.

    Lilybiri

  • brand value in the time table with colors according to the selected employee

    Hello
    My question is
    I created the time table for a class for a bit longer want to filter to the time table used.

    for example. If I select the emp_id he's from, select the list then this period of teaching should be highlighted time table.
    Please can u help me.

    the table name is:-Time_Table
    the columns are:-

    EMP_ID
    CLASS_ID
    SECTION
    SUBJECT_ID
    PERIOD_NO
    DAY
    DATE


    Thank you
    Nisha

    Published by: Nisha Rani on September 3, 2009 02:57

    Published by: Nisha Rani on September 3, 2009 23:08

    Hi Nisha,

    Try this:

    SELECT
    DY,
    MIN(CASE WHEN LEC_NO = '1' THEN
    CASE WHEN EMP_ID = :P1_EMP_ID THEN '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' ELSE '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' END ELSE NULL END) PERIOD1, MIN(CASE WHEN LEC_NO = '2' THEN CASE WHEN EMP_ID = :P1_EMP_ID THEN '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' ELSE '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' END ELSE NULL END) PERIOD2, MIN(CASE WHEN LEC_NO = '3' THEN CASE WHEN EMP_ID = :P1_EMP_ID THEN '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' ELSE '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' END ELSE NULL END) PERIOD3, MIN(CASE WHEN LEC_NO = '4' THEN CASE WHEN EMP_ID = :P1_EMP_ID THEN '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' ELSE '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' END ELSE NULL END) PERIOD4, MIN(CASE WHEN LEC_NO = '5' THEN CASE WHEN EMP_ID = :P1_EMP_ID THEN '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' ELSE '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' END ELSE NULL END) PERIOD5, MIN(CASE WHEN LEC_NO = '6' THEN CASE WHEN EMP_ID = :P1_EMP_ID THEN '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' ELSE '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' END ELSE NULL END) PERIOD6, MIN(CASE WHEN LEC_NO = '7' THEN CASE WHEN EMP_ID = :P1_EMP_ID THEN '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' ELSE '
    ' || SUBJECT_ID || '-' ||emp_id || '
    ' END ELSE NULL END) PERIOD7 FROM TM_TEACHER_LEC_DETAIL WHERE CLASS_ID = :P1_CLASS_ID and SECTION = :P1_SECTION GROUP BY DY order by dy

    As I do not have the structure of your table or any data, I can't test this. Let me know if it works for you

    Andy

  • a patch can change the release date and time table psrelease?

    a patch can change the release date and time table psrelease?

    Thank you.

    What kind of patch? A bundle? A maintenance plan? An upgrade of the application?
    In any case, I'm sure that it does not change any date, but he has a line in this table.

    Nicolas.

  • Cannot start area Planner and the server process in the machine virtual App/lot

    Hello

    After the change of /etc/tnsnames.ora in the machine virtual App/Batch:

    [Psadm2@psovmab LOG] $ /etc/tnsnames.ora more
    H91TMPLT =
    (DESCRIPTION =
    (ADDRESS_LIST =
    ((ADDRESS = (PROTOCOL = TCP)(HOST=192.168.1.133) (PORT = 1521)))
    (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = H91TMPLT.corp.peoplesoft.com))
    )

    I can't start Task Scheduler field and the server process:

    NLS:4: Cannot open the message TMADMIN_CAT, the value 1, num 197 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    NLS:4: Cannot open the message TMADMIN_CAT, the value 1, num 198 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    INFO: Oracle Tuxedo, 10.3.0.0, 64-bit Version, Patch level (none)
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 793 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec BBL - one:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 773 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    NLS:4: Cannot open the message TMADMIN_CAT, the value 1, num 495 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    Try to start...
    INFO: Oracle Tuxedo, 10.3.0.0, 64-bit Version, Patch level (none)
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 801 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSWATCHSRV o ./LOGS/stdout e ./LOGS/stderr - A - ID - 55021 d APPDOM s PSWATCHSRV:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSAPPSRV o EI ./LOGS/stdout. /LOGS/ [email protected] d s PSAPPSRV:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSAPPSRV o EI ./LOGS/stdout. /LOGS/ [email protected] d s PSAPPSRV:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSQRYSRV o EI ./LOGS/stdout. /LOGS/ [email protected] d s PSQRYSRV:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSSAMSRV o ./LOGS/stdout e ./LOGS/stderr - A - APPDOM d s PSSAMSRV:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSBRKHND o EI ./LOGS/stderr s PSBRKHND_dflt:BrkProcess - APPDOM d s PSBRKHND_dflt ./LOGS/stdout:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSBRKDSP o EI ./LOGS/stderr s PSBRKDSP_dflt:Dispatch - APPDOM d s PSBRKDSP_dflt ./LOGS/stdout:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSPUBHND o EI ./LOGS/stderr s PSPUBHND_dflt:PubConProcess - APPDOM d s PSPUBHND_dflt ./LOGS/stdout:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSPUBDSP o EI ./LOGS/stderr s PSPUBDSP_dflt:Dispatch - APPDOM d s PSPUBDSP_dflt ./LOGS/stdout:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSSUBHND o EI ./LOGS/stderr s PSSUBHND_dflt:SubConProcess - APPDOM d s PSSUBHND_dflt ./LOGS/stdout:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSSUBDSP o EI ./LOGS/stderr s PSSUBDSP_dflt:Dispatch - APPDOM d s PSSUBDSP_dflt ./LOGS/stdout:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec PSMONITORSRV o ./LOGS/stdout e ./LOGS/stderr - A - ID - 55021 d APPDOM s PSMONITORSRV:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec JSL o ./LOGS/stdout e ./LOGS/stderr - A - d - m 5 - M 7 - //hrapp.xflash.com:9000 I have 5-j ANY - 40 x 10 - c 1000000 JSH w s:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    exec JREPSVR o ./LOGS/stdout e ./LOGS/stderr - A - W Pei /home/psadm2/ps/pt/8.50/appserv/APPDOM/jrepository:
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 820 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8
    NLS:4: Cannot open the message CMDTUX_CAT, the value 1, num 774 catalogue; Check TUXDIR = / opt/oracle/TFTP/appbatch/bea/tuxedo, LANG = fr_FR. UTF-8

    Thank you

    Please, once you connect to the application server Peoplesoft VM with psadm2, run the following:

    env|grep LANG
    

    And post the result.

    LANG should be C, if this isn't your side follow these steps:

    export LANG=C
    

    And re-start the Appserver field.
    To keep consistency during the startup of the server, add the line in the psadm2 user .bash_profile.

    Changed the .bash_profile or any other initialization file? Because everything should be fine by default.

    Nicolas.

    Published by: Gasparotto N on December 30, 2009 19:09

  • Accelerate the selection * of a table

    Hi all

    OS: RHEL

    DB: 11 gR 2

    Is it possible that we can accelerate the selection * of a table?

    Kind regards

    $phinx19 wrote:

    Hi all

    OS: RHEL

    DB: 11 gR 2

    Is it possible that we can accelerate the selection * of a table?

    Kind regards

    # If it is everything you write, you get a full table scan independently of all the indexes that exist on this table:

    SQL > create table (yazflutt)

    snorm number 2.

    3 gleezle varchar2 (40),

    date of Halloween 4,

    Number 5 art);

    Table created.

    SQL >

    SQL > start

    2 for i in 1.10000 loop

    3. insert into yazflutt

    4 values (i, 'pourles yinko' |) I |'! (', sysdate - I, i);

    5 end of loop;

    6

    7 validation;

    8 end;

    9.

    PL/SQL procedure successfully completed.

    SQL >

    SQL > set autotrace on

    SQL >

    SQL > select * from yazflutt;

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    yinko 567 567 pourles!                        15 APRIL 14 567

    yinko 568 568 pourles!                        14 APRIL 14 568

    ...

    9982 yinko 9982 pourles!                       5 JULY 88 9982

    9983 pourles yinko 9983!                       4 JULY 88 9983

    9984 yinko 9984 pourles!                       3 JULY 88 9984

    9985 pourles yinko 9985!                       2 JULY 88 9985

    9986 yinko 9986 pourles!                       1 JULY 88 9986

    9987 yinko 9987 pourles!                       30 JUNE 88 9987

    9988 yinko 9988 pourles!                       29 JUNE 88 9988

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    9989 yinko 9989 pourles!                       9989 JUNE 28, 88

    yinko 9990 9990 pourles!                       JUNE 27 88 9990

    9991 yinko 9991 pourles!                       9991 26 JUNE 88

    9992 yinko 9992 pourles!                       25 JUNE 88 9992

    9993 yinko 9993 pourles!                       9993 JUNE 24, 88

    9994 yinko 9994 pourles!                       23 JUNE 88 9994

    9995 pourles yinko 9995!                       9995 22 JUNE 88

    yinko 9996 9996 pourles!                       JUNE 21 88 9996

    9997 yinko 9997 pourles!                       20 JUNE 88 9997

    9998 pourles yinko 9998!                       9998 19 JUNE 88

    yinko 9999 9999 pourles!                       18 JUNE 88 9999

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    10000 pourles 10000 yinko!                      JUNE 17, 88 10000

    10000 selected lines.

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 2573332187

    ------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    ------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |          | 10000 |   556K |    10 (10) | 00:00:01 |

    |   1.  TABLE ACCESS FULL | YAZFLUTT | 10000 |   556K |    10 (10) | 00:00:01 |

    ------------------------------------------------------------------------------

    Note

    -----

    -the dynamic statistics used: dynamic sampling (level = 2)

    Statistics

    ----------------------------------------------------------

    9 recursive calls

    0 db block Gets

    795 consistent gets

    0 physical reads

    0 redo size

    488545 bytes sent via SQL * Net to client

    7877 bytes received via SQL * Net from client

    668 SQL * Net back and forth to and from the client

    0 sorts (memory)

    0 sorts (disk)

    10000 rows processed

    SQL >

    SQL > set autotrace off

    SQL >

    SQL > create index yazflutt_idx1 on yazflutt (snorm);

    The index is created.

    SQL >

    SQL > create index yazflutt_idx2 on yazflutt (gleezle);

    The index is created.

    SQL >

    SQL > create index yazflutt_idx3 on yazflutt (hopple);

    The index is created.

    SQL >

    SQL > create index yazflutt_idx4 on yazflutt (art);

    The index is created.

    SQL >

    SQL > exec dbms_stats.gather_table_stats (user, 'YAZFLUTT',-online true waterfall, estimate_percent-online null)

    PL/SQL procedure successfully completed.

    SQL >

    SQL > set autotrace on

    SQL >

    SQL > select * from yazflutt;

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    yinko 567 567 pourles!                        15 APRIL 14 567

    yinko 568 568 pourles!                        14 APRIL 14 568

    yinko 569 569 pourles!                        APRIL 13, 14 569

    ...

    9983 pourles yinko 9983!                       4 JULY 88 9983

    9984 yinko 9984 pourles!                       3 JULY 88 9984

    9985 pourles yinko 9985!                       2 JULY 88 9985

    9986 yinko 9986 pourles!                       1 JULY 88 9986

    9987 yinko 9987 pourles!                       30 JUNE 88 9987

    9988 yinko 9988 pourles!                       29 JUNE 88 9988

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    9989 yinko 9989 pourles!                       9989 JUNE 28, 88

    yinko 9990 9990 pourles!                       JUNE 27 88 9990

    9991 yinko 9991 pourles!                       9991 26 JUNE 88

    9992 yinko 9992 pourles!                       25 JUNE 88 9992

    9993 yinko 9993 pourles!                       9993 JUNE 24, 88

    9994 yinko 9994 pourles!                       23 JUNE 88 9994

    9995 pourles yinko 9995!                       9995 22 JUNE 88

    yinko 9996 9996 pourles!                       JUNE 21 88 9996

    9997 yinko 9997 pourles!                       20 JUNE 88 9997

    9998 pourles yinko 9998!                       9998 19 JUNE 88

    yinko 9999 9999 pourles!                       18 JUNE 88 9999

    SNORM GLEEZLE HALLOWEEN ART

    ---------- ---------------------------------------- --------- ----------

    10000 pourles 10000 yinko!                      JUNE 17, 88 10000

    10000 selected lines.

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 2573332187

    ------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    ------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |          | 10000 |   341K |    10 (10) | 00:00:01 |

    |   1.  TABLE ACCESS FULL | YAZFLUTT | 10000 |   341K |    10 (10) | 00:00:01 |

    ------------------------------------------------------------------------------

    Statistics

    ----------------------------------------------------------

    1 recursive calls

    0 db block Gets

    725 consistent gets

    0 physical reads

    0 redo size

    488545 bytes sent via SQL * Net to client

    7877 bytes received via SQL * Net from client

    668 SQL * Net back and forth to and from the client

    0 sorts (memory)

    0 sorts (disk)

    10000 rows processed

    SQL >

    SQL > set autotrace off

    SQL >

    Whatever the index in place a ' select * ' makes a full table scan, period.  Unless you can optimize your storage space, memory, or even use version 11.2 laters results cache and there is not a lot you can do.

    David Fitzjarrell

  • call to the Ajax process work does not correctly

    Hi guys Apex.

    I am new to apex and need a little help with a bug in my next javascript.

    I have an anonymous pl/sql block that shows me a list of products, so that the user can enter a few quantityes on those desired.

    I got another part of HTML that contains the JavaScript in this region, I check the quantity selected by the user (account product id and quantity entered) and the end of the page, there are 2 buttons.

    The first is to generate totals of runing, it works perfectly.

    The second add the products in the Collection (calling a callback procedure Ajax ADD_PRODUCTS) and finally in the same process of button, I save the order until the final table on my db, the latter a speech to another process to recall Ajax calles RECORD.

    The bug that I have is that the process is not save the entire products on my database, a few times for example if I get quantities for 10 products, the process saves me only 8 or 7, it's a random outcome.

    I looked at the code and seems that the problem is on my ADD_PRODUCTS process, because on my javascript where I call him, I have displayed on the screen, the total order quantity and runnign and it shows perfect, always.

    I use the Application Express 4.2.2.00.11 on DB SE

    next is:

    1 - Javascript

    2 - ADD_PRODUCTS ajax

    3 - RECORD Ajax

    Thanks for the tips,

    MJ

    -------

    1 JavaScript

    -------

    < ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 / / IN" "http://www.w3.org/TR/html4/strict.dtd" > ""

    < html >

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf - 8 ">

    Totalizar < title > < / title >

    < script type = "text/javascript" >

    $(function () {})

    () $("#Calculate").click

    Mueve el valor al campo of amount

    function () {}

    var total = 0;

    var total_qty = 0;

    () $("input[name=f_qty]").each

    function () {}

    var amount = $(this) .val ();

    var productId = $(this).parents('tr') .find ("input [name = f_prod_id]") .val ();

    If (amount! == ") {}

    price var = $(this).parents('tr') .find ("input [name = f_unit_price]") .val ();

    var prodtotal = (quantity * price);

    Total = total + prodtotal;

    total_qty = total_qty + 1;

    }

    }

    );

    $('#printHere').html (decimalizer (total));

    $('#printHereqty').html (total_qty);

    }

    );

    funcion para formatear el resultado one shark 2 decimal places

    function decimalizer (input) {}

    var Test1 = 0;

    var test2 = 0;

    entry = Math.round(input * 100);

    If (input / 100 == Math.round(input / 100)) {}

    Test1 = 1;

    } ElseIf (entry / 10 == Math.round(input / 10)) {}

    Test2 = 1;

    }

    If (test1 == 1 & & test2 == 0) {}

    return (input / 100 + ".") 00');

    } ElseIf (test1 == 0 & & test2 == 1) {}

    return (input / 100 + '0');

    } else {}

    return (input / 100);

    }

    }

    -Starts process of application del pedido.

    Apply el Pedido

    () $("#Save").click

    -Add products to the collection

    function () {}

    () $("input[name=f_qty]").each

    function () {}

    var amount = $(this) .val ();

    var productId = $(this).parents('tr') .find ("input [name = f_prod_id]") .val ();

    If (amount! == ") {}

    $("#P1_CANTIDAD_PEDIDO").val (quantity);

    $("#P1_PRODUCT_ID").val (productId);

    Apex. Server.Process ("ADD_PRODUCTS", {}

    pageItems: ' #P1_CANTIDAD_PEDIDO, #P1_PRODUCT_ID.

    });

    }

    }

    );

    PlaceOrder();

    });

    -Add los productos end has the Collection-

    function placeorder() {}

    Apex. Server.Process ("SAVE", {pageItems: "#P1_CODIGO_CLIENTE, #P1_TIPO_CLIENTE"});

    var total = 0;

    var total_qty = 0;

    Alert ('Medal created');

    Poner en 0 las cantidades digitadas

    () $("input[name=f_qty]").each

    function () {}

    var amount = $(this) .val ();

    If (amount! == ") {}

    $(this) .val ('');

    }

    }

    );

    $('#printHere').html ((total));

    $('#printHereqty').html (total_qty);

    }

    });

    < /script >

    < / head >

    < body >

    < div id = "total" > < / div >

    < p >

    < strong > ORDER TOTAL:

    < span id = "printHere" > < / span >

    < facilities >

    < /p >

    < p >

    < strong > ORDER PRODUCTS:

    < span id = "printHereqty" > < / span >

    < facilities >

    < /p >

    < p align = "center" style = "" clear: both; ">"

    < button type = "button" style = "' make-weight: bold;background-color:lightgray;margin-left:auto;margin-right:auto;display:block;margin-top:0%;margin-bottom:0%" id = 'Calculate' > total 120 Hz < / button > "

    < /p >

    < p align = "left" style = "" clear: both; ">"

    < button type = "button" style = "' make-weight: bold;background-color:lightgray;margin-left:auto;margin-right:auto;display:block;margin-top:5%;margin-bottom:5%" id = "Save" > order < / button > "

    < /p >

    < / body >

    < / html >

    -------

    2 ADD_PRODUCTS

    -------

    Start

    apex_collection.add_member (p_collection_name = > 'ORDER',)

    p_c001 = >: P1_PRODUCT_ID,.

    p_c003 = > sib_precio_cte_prod ('001 ', ' 1776',: P1_PRODUCT_ID).

    p_c004 = >: P1_CANTIDAD_PEDIDO

    );

    END;

    -------

    3 SAVE

    -------

    declare

    number of l_order_id;

    l_count number;

    l_customer_id varchar2 (30): =: P1_CODIGO_CLIENTE;

    Start

    -Insert a row into the table Order Header

    insert into cab_orders (customer_id, order_total, order_timestamp, user_name)

    values (l_customer_id, upper(:APP_USER), null, systimestamp) back into l_order_id order_id;

    commit;

    insert into det_order (order_item_id, order_id, product_id, unit_price, quantity)

    Select null, l_order_id, to_number (c001), to_number (c003), to_number (c004) from apex_collections where collection_name = "ORDER";

    commit;

    -The value of the P1_numero_orden order point which was placed just

    : P1_numero_orden: = l_order_id;

    -Truncate the collection once the order has been placed

    apex_collection.create_or_truncate_collection (p_collection_name = > 'ORDER');

    l_count: = APEX_COLLECTION. COLLECTION_MEMBER_COUNT (p_collection_name = > 'ORDER');

    : P1_cantidad_registros: = l_count;

    end;

    It is no doubt a few classic miss the A in AJAX. When execute you a loop on the orders you make an ajax call for each, and after the loop, you trigger the placeorder ajax call. However, it might be that ajax add_products calls have not finished yet at the point where you call the placeorder call. This would explain the apparently random quantity of the entered orders: orders may simply not have made it in time to the collection.

    Another you're not processing orders where the quantity has not been met, but this probably isn't the cause since you mention that you have filled with quantities.

    The solution is to: have / do these add_order synchronous requests or B / keep them asynchronous and learn something new, called promises

    A crash the browser because do you wait before the end of his run - but it's maybe not really noticeable so would find you acceptable.

    apex.server.process("ADD_PRODUCTS", {
        pageItems: "#P1_CANTIDAD_PEDIDO,#P1_PRODUCT_ID"
    },
    {async: false})
    

    B is more interesting. You have a variable amount of ajax calls and want to wait until they have all completed in order to do something else. Promise interfaces provide this feature in the async environment and jquery has its own implementation of it. I suggest Googling it and read on this topic - its very interesting and it will be part of the future (alone, today!)

    $("#Save").click(
        // ----- Agregar los productos a la collection
        function () {
            //array to hold all the ajax requests
            var requests = Array();
            $("input[name=f_qty]").each(
                function () {
                    var quantity = $(this).val();
                    var productId = $(this).parents('tr').find("input[name=f_prod_id]").val();
                    if (quantity !== '') {
                        $("#P1_CANTIDAD_PEDIDO").val(quantity);
                        $("#P1_PRODUCT_ID").val(productId);
                        requests.push(
                          apex.server.process("ADD_PRODUCTS", {
                              pageItems: "#P1_CANTIDAD_PEDIDO,#P1_PRODUCT_ID"
                          })
                        );
                    };
                };
            );
            //when all ajax calls are completed act on the done callback
            var defer = $.when.apply($, requests);
            defer.done(function(){
              placeOrder();
            });
        });
    

    Here are some links with relevant information on this solution:

    Apex.Server.process JavaScript APIs

    The return value of this function is a jqXHR object. This is required to use the interface of the promise! Once again at the apex, the hats of the team for this great new feature ajax

    jQuery.Ajax. jQuery API Documentation

    Documentation on the jquery ajax function. It contains information about the jqXHR object and shows all the options available. For reference.

    Wait until any jquery ajax request are done? -Stack overflow

    jQuery when troubleshooting with a variable number of arguments - Stack Overflow

    StackOverflow questions / answers lets get this solution. More info in them!

    jQuery.when () | jQuery API Documentation

    When interface $ you see used

    https://developer.Mozilla.org/en-us/docs/Web/JavaScript/reference/Global_Objects/function/apply

    Information about using "apply" If you've not seen before. It has been used in the solution of SO due to the variable number of arguments - very interesting!

  • Plan the work that runs according to max date in the source to create table

    Hi all

    I am trying to create an automation in my sql. Basically, I have a table I do reporting and analysis on which is a subset of records from a source table. For the purposes of this example, I called the source table "src_table" and my table as the target table, "tgt_table." Essentially the source table gets updated with a value again months from date (founded order_dt) and I have a procedure I call when the source table is updated to load the value of the new month of records in my target table. So let say June 2012 data is loaded in the source table, I call my procedure that has a date parameter and enter June 2012 as the point of departure date so that it looks for new records in the source table from June 1, 2012 and load it into my target table. For variety reasons I won't get in, my goal in a position is not a view, there must be a stand alone table. The problem is that the source never table gets updated at the same speed interval... sometimes they will load a new months of data at the beginning of the following month, sometimes medium of the month... sometimes I have to wait a few months to get another month of data. So, whenever I get a email notification telling me another month of data is loaded in the source table, I have a windows batch file that runs my setting... I just have to change the start date (based on the order_dt column) and run it. I want to do is automate the process so that I did not yet do. What do I think creates a task that runs every day or even at the end of each month, this work has basically seized the date of maximum order of the source table and if the date of the order is greater than the maximum order date in my target table, it runs my procedure that loads the new month with a value of data in my target table. Thus, for example, my maximum order of my target table date is May 31, 2012. The work runs at a certain period of time and check the maximum date on the source table, if the maximum date is May 31 nothing happens... new data has not been loaded so does not perform the procedure. If the maximum date on the source table is June 30, 2012, the maximum date is greater than the maximum in my table target date so that the procedure runs. I need also the procedure to insert records into the table in the source where the order date in the source table is > = at the time of maximum order in the target table.

    In a Word, this is what I need but I'm not sure how to put in place. The procedure works fine... all I need is an interim procedure that runs as a scheduled task every x number of days and the date of maximum order check on the source table if it exceeds the maximum order on my table of target date it runs my procedure. My procedure is called "insert_new_orders" and when I run it I run it like:

    execute insert_new_orders('01-jun-2012');

    If anyone can help me with what would be great :-)

    Thank you
    Ed

    To start:
    You must remove the EXECUTE keyword.

Maybe you are looking for

  • Master password prompt steals focus

    I have no problem entering my main password for each session. However, the prompt to the unpredictable times, sometimes I'm in the process of typing something else (IE a URL).Is there a setting anywhere to stop the guest to steal my attention so I ca

  • Mac Book stop with the movie in the dvd player, and now it opens in the reset password screen?

    I'm running OS X El Capitan 10.11.5 and my daughter and her friends used to watch a movie last night and stop it before releasing the film. My Mac Book Pro is the start of the password reset screen/mode? It gives me only 3 options, none of which is t

  • How to change code html for standard pages; update of plugins?

    When I go to check plugin firefox, the entire html page (Yes, long pages of phrases highlighted blue and black type. plain and absolutely no way to understand what I'm doing) is the same for yahoo answers (in which case the sentence blue-options and

  • HP Envy 4505

    With the printer mode Direct wireless and I - pad info box showing who says that the job was sent to the HP Envy 4505, the job does not print. No idea what I'm doing wrong or is this a malfunction of the printer? Thank you.

  • CD-ROM/DVD-Rom drive not detected

    I have a Toshiba Satellite l300d with an OS Vista Home premium. It worked fine for 3 years, but last week, I can't find the cd drive in 'my computer' and am unable to read DVDs, games, etc. The Toshiba MK1652GSK ATA device appears in Device Manager a