Help in the optimization of a query update

Hi gurus,

I'm trying to optimize the query update on a large TT_TERM_HIST table below (table size is 13 GB).

The update statement is supposed to update the lines ~ 7 M. Total number of lines are ~ 9 M.

The TT_TERM table is also large (table size is 9.5 GB) and PK on column DEAL_NUM.

UPDATE  tt_term_hist hist
   SET LOCAL_BANKING_SYSTEM19 =
          (SELECT LOCAL_BANKING_SYSTEM19
             FROM tt_term tt
            WHERE tt.deal_num = hist.deal_num)
WHERE hist.deal_num IN
          (SELECT deal_num
             FROM tt_term
            WHERE SUBSTR (LOCAL_BANKING_SYSTEM19, 1, 5) IN
                     ('FT7FC', 'FT7MC', 'FT7TM')) ;

Performance plan is as follows:


-----------------------------------------------------------------------------------------------
| Id  | Operation                    | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------------
|   0 | UPDATE STATEMENT             |                |   266K|  6763K|  1756K (16)| 05:51:23 |
|   1 |  UPDATE                      | TT_TERM_HIST   |       |       |            |          |
|   2 |   NESTED LOOPS               |                |   266K|  6763K|   691K  (1)| 02:18:16 |
|*  3 |    TABLE ACCESS FULL         | TT_TERM        | 44729 |   742K|   333K  (1)| 01:06:41 |
|*  4 |    INDEX RANGE SCAN          | IRTERM_HIST_PK |     6 |    54 |     2   (0)| 00:00:01 |
|   5 |   TABLE ACCESS BY INDEX ROWID| TT_TERM        |     1 |    17 |     3   (0)| 00:00:01 |
|*  6 |    INDEX UNIQUE SCAN         | IRTERM_PK      |     1 |       |     2   (0)| 00:00:01 |
-----------------------------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------


   3 - filter(SUBSTR("LOCAL_BANKING_SYSTEM19",1,5)='FT7FC' OR
              SUBSTR("LOCAL_BANKING_SYSTEM19",1,5)='FT7MC' OR
              SUBSTR("LOCAL_BANKING_SYSTEM19",1,5)='FT7TM')
   4 - access("HIST"."DEAL_NUM"="DEAL_NUM")
   6 - access("TT"."DEAL_NUM"=:B1)

Then, I created a function-based index table TT_TERM using the function 'SUBSTR (LOCAL_BANKING_SYSTEM19, 1, 5)' and the plan amended as follows:

-------------------------------------------------------------------------------------------------
| Id  | Operation                      | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------------------------
|   0 | UPDATE STATEMENT               |                | 89688 |  2364K|   480K (19)| 01:36:06 |
|   1 |  UPDATE                        | TT_TERM_HIST   |       |       |            |          |
|   2 |   NESTED LOOPS                 |                | 89688 |  2364K|   121K  (1)| 00:24:21 |
|   3 |    INLIST ITERATOR             |                |       |       |            |          |
|   4 |     TABLE ACCESS BY INDEX ROWID| TT_TERM        | 15060 |   264K|  1225   (0)| 00:00:15 |
|*  5 |      INDEX RANGE SCAN          | CS_TERM_LBS19  |  6024 |       |    17   (0)| 00:00:01 |
|*  6 |    INDEX RANGE SCAN            | IRTERM_HIST_PK |     6 |    54 |     2   (0)| 00:00:01 |
|   7 |   TABLE ACCESS BY INDEX ROWID  | TT_TERM        |     1 |    17 |     3   (0)| 00:00:01 |
|*  8 |    INDEX UNIQUE SCAN           | IRTERM_PK      |     1 |       |     2   (0)| 00:00:01 |
-------------------------------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------


   5 - access(SUBSTR("LOCAL_BANKING_SYSTEM19",1,5)='FT7FC' OR
              SUBSTR("LOCAL_BANKING_SYSTEM19",1,5)='FT7MC' OR
              SUBSTR("LOCAL_BANKING_SYSTEM19",1,5)='FT7TM')
   6 - access("HIST"."DEAL_NUM"="DEAL_NUM")
   8 - access("TT"."DEAL_NUM"=:B1)

Try to use the index PARALLEL is shooting to the high cost in Millions.

UPDATE /*+ PARALLEL */ tt_term_hist hist
   SET LOCAL_BANKING_SYSTEM19 =
          (SELECT LOCAL_BANKING_SYSTEM19
             FROM tt_term tt
            WHERE tt.deal_num = hist.deal_num)
WHERE hist.deal_num IN
          (SELECT deal_num
             FROM tt_term
            WHERE SUBSTR (LOCAL_BANKING_SYSTEM19, 1, 5) IN
                     ('FT7FC', 'FT7MC', 'FT7TM')) ;

----------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name          | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
----------------------------------------------------------------------------------------------------------------------------------
|   0 | UPDATE STATEMENT                    |               |  6096K|   156M|    24M (25)| 81:18:18 |        |      |            |
|   1 |  UPDATE                             | TT_TERM_HIST  |       |       |            |          |        |      |            |
|   2 |   PX COORDINATOR                    |               |       |       |            |          |        |      |            |
|   3 |    PX SEND QC (RANDOM)              | :TQ10002      |  6096K|   156M|  4482   (1)| 00:00:54 |  Q1,02 | P->S | QC (RAND)  |
|*  4 |     HASH JOIN BUFFERED              |               |  6096K|   156M|  4482   (1)| 00:00:54 |  Q1,02 | PCWP |            |
|   5 |      BUFFER SORT                    |               |       |       |            |          |  Q1,02 | PCWC |            |
|   6 |       PX RECEIVE                    |               |  1023K|    17M|  1225   (0)| 00:00:15 |  Q1,02 | PCWP |            |
|   7 |        PX SEND HASH                 | :TQ10000      |  1023K|    17M|  1225   (0)| 00:00:15 |        | S->P | HASH       |
|   8 |         INLIST ITERATOR             |               |       |       |            |          |        |      |            |
|   9 |          TABLE ACCESS BY INDEX ROWID| TT_TERM       |  1023K|    17M|  1225   (0)| 00:00:15 |        |      |            |
|* 10 |           INDEX RANGE SCAN          | CS_TERM_LBS19 |  6024 |       |    17   (0)| 00:00:01 |        |      |            |
|  11 |      PX RECEIVE                     |               |  9007K|    77M|  3257   (1)| 00:00:40 |  Q1,02 | PCWP |            |
|  12 |       PX SEND HASH                  | :TQ10001      |  9007K|    77M|  3257   (1)| 00:00:40 |  Q1,01 | P->P | HASH       |
|  13 |        PX BLOCK ITERATOR            |               |  9007K|    77M|  3257   (1)| 00:00:40 |  Q1,01 | PCWC |            |
|  14 |         TABLE ACCESS FULL           | TT_TERM_HIST  |  9007K|    77M|  3257   (1)| 00:00:40 |  Q1,01 | PCWP |            |
|  15 |   TABLE ACCESS BY INDEX ROWID       | TT_TERM       |     1 |    17 |     3   (0)| 00:00:01 |        |      |            |
|* 16 |    INDEX UNIQUE SCAN                | IRTERM_PK     |     1 |       |     2   (0)| 00:00:01 |        |      |            |
----------------------------------------------------------------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------


   4 - access("HIST"."DEAL_NUM"="DEAL_NUM")
  10 - access(SUBSTR("LOCAL_BANKING_SYSTEM19",1,5)='FT7FC' OR SUBSTR("LOCAL_BANKING_SYSTEM19",1,5)='FT7MC' OR
              SUBSTR("LOCAL_BANKING_SYSTEM19",1,5)='FT7TM')
  16 - access("TT"."DEAL_NUM"=:B1)

The Pb, I train of CARS with 2 nodes. DB version details are as follows:

SQL> select banner from v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

Please let know us your opinion on how to optimize the query. Please let me know in case you need other inputs.

Hello

"The update statement is supposed to update the lines ~ 7 M." "Total number of lines are ~ 9 M."
Could specify total number by each table? It makes sense to use "hash join" to join table?
Try to replace 'in' also exists.

You can try to update the join, it might help to exclude a single step to join as:

UPDATE ( SELECT HIST.LOCAL_BANKING_SYSTEM19 OLD_VAL , TT.LOCAL_BANKING_SYSTEM19 NEW_VAL
           FROM TT_TERM_HIST HIST, TT_TERM TT
          WHERE TT.DEAL_NUM = HIST.DEAL_NUM
            AND SUBSTR (LOCAL_BANKING_SYSTEM19, 1, 5) IN ('FT7FC', 'FT7MC', 'FT7TM')
       )
SET OLD_VAL = NEW_VAL
;

! WARNING! It is just not tested sample.

WBR,

Tags: Database

Similar Questions

  • Need help in the optimization of the query with the Group and joins by clause

    I'm having the problem by running the following query... It takes a lot of time. To simplify, I added the two tables FILE_STATUS = stores the file load details and COMM table Board table job showing records treated successfully and which was communicated to the other system real. Records with status = T is trasnmitted to another system and traansactions with P is waiting.
    CREATE TABLE FILE_STATUS
    (FILE_ID VARCHAR2(14),
    FILE_NAME VARCHAR2(20),
    CARR_CD VARCHAR2(5),
    TOT_REC NUMBER,
    TOT_SUCC NUMBER);
    
    CREATE TABLE COMM
    (SRC_FILE_ID VARCHAR2(14),
    REC_ID NUMBER,
    STATUS CHAR(1));
    
    INSERT INTO FILE_STATUS VALUES ('12345678', 'CM_LIBM.TXT', 'LIBM', 5, 4);
    INSERT INTO FILE_STATUS VALUES ('12345679', 'CM_HIPNT.TXT', 'HIPNT', 4, 0);
    
    INSERT INTO COMM VALUES ('12345678', 1, 'T');
    INSERT INTO COMM VALUES ('12345678', 3, 'T');
    INSERT INTO COMM VALUES ('12345678', 4, 'P');
    INSERT INTO COMM VALUES ('12345678', 5, 'P');
    COMMIT;
    Here's the query I wrote to give me the details of the file that has been loaded into the system. He reads the table of State and the commission files to display the name of the file, total records loaded, total at the table of the commission and the number of records which has finally been passed successfully loaded (Status = T) with other systems.
    SELECT 
        FS.CARR_CD 
        ,FS.FILE_NAME 
        ,FS.FILE_ID
        ,FS.TOT_REC
        ,FS.TOT_SUCC
        ,NVL(C.TOT_TRANS, 0) TOT_TRANS
    FROM FILE_STATUS FS
    LEFT JOIN
    (
        SELECT SRC_FILE_ID, COUNT(*) TOT_TRANS
        FROM COMM
        WHERE STATUS = 'T'
        GROUP BY SRC_FILE_ID
    ) C ON C.SRC_FILE_ID = FS.FILE_ID
    WHERE FILE_ID = '12345678';
    In production, this request has several joins and takes a long time to deal with... the main culprit for me is the join on the COMM table to count the number of number of transactions sent. Please can you give me tips to optimize this query to get results faster? What I need to delete the Group and use the partition or something else. Help, please!

    Don't know if it will be faster based on the information provided, but analytical functions offer an alternative approach;

    select carr_cd, file_name, file_id, tot_rec, tot_succ, tot_trans
      from (select fs.carr_cd,
                   fs.file_name,
                   fs.file_id,
                   fs.tot_rec,
                   fs.tot_succ,
                   count(case
                            when c.status = 'T' then
                             1
                            else
                             null
                          end) over(partition by c.src_file_id) tot_trans,
                   row_number() over(partition by c.src_file_id order by null) rn
              from file_status fs
              left join comm c
                on c.src_file_id = fs.file_id
             where file_id = '12345678')
     where rn = 1;
    
    CARR_CD FILE_NAME            FILE_ID           TOT_REC   TOT_SUCC  TOT_TRANS
    ------- -------------------- -------------- ---------- ---------- ----------
    LIBM    CM_LIBM.TXT          12345678                5          4          2
    
  • Need help with the error Code 80244019 Windows Update

    From: Doug

    I get code 80244019 whenever I try to use Windows Update. I tried to change the DWORD in regedit nothing helps... Norton has recently found and 'resolved' trojan.zlob in 128 files in the registry, 21 cases (10 of which were in system32) and 1 browser cache. Whenever I try to use IE to go to http://windowsupdate.microsoft.com I am redirected to msn.com.

    Any advice or solutions would be welcome.

    From: PA bear [MS MVP]

    Chances are that ZLOB was not completely removed and she was accompanied by infections Vundo and SDBot variant, all protected by a rootkit infection. You are going to need specialized assistance to clean this machine,

    Unexplained computer behavior may be caused by deceptive software

    http://support.Microsoft.com/kb/827315

    Run a check of /thorough/ for hijackware, including post your hijackthis on a proper forum log.

    Verification / help with Hijackware

    http://aumha.org/a/parasite.htm

    http://aumha.org/a/quickfix.htm

    http://aumha.NET/viewtopic.php?t=5878

    http://wiki.CastleCops.com/Malware_Removal_and_Prevention:_Introduction

    http://MVPs.org/winhelp2002/unwanted.htm

    http://inetexplorer.MVPs.org/data/prevention.htm

    http://inetexplorer.MVPs.org/tshoot.html

    http://www.MVPs.org/sramesh2k/Malware_Defence.htm

    http://defendingyourmachine2.blogspot.com/

    http://www.elephantboycomputers.com/page2.html#Removing_Malware

    When all else fails, HijackThis v2.0.2

    (http://aumha.org/downloads/hijackthis.exe) is the tool to use.

    It will help you to identify and remove any hijackware/spyware with

    assistance of an expert.  * Post your log to

    http://aumha.NET/viewforum.php?f=30,

    http://forums.Spybot.info/forumdisplay.php?f=22,

    http://CastleCops.com/forum67.html, or other appropriate review bodies

    by an expert in the field, not here.* *.

    If the procedures look too complex - and there is no shame in admitting

    isn't your cup of tea - take the local machine, good reputation and

    independent computer repair shop (i.e., not BigBoxStoreUSA).

    --

    ~ Robear Dyer (PA Bear)

    Another response of the community of Windows Vista discussion groups

  • Need help on the regular expressions and query

    Hi guru s, I hope that you all made great!

    I have a scenario where I need to insert data into the table.

    I have three scenarios:
    select 'Kodali,Raj,S' str from dual
    union 
    select 'Alex Romano' from dual
    union 
    select 'ppppp' from dual
    
    Alex Romano
    Kodali,Raj,S
    ppppp
    What I want is now.

    1 Alex Romano
    is there space between the chain and then I want to insert in the last name and first name columns
    2 Xavier, Raj, S
    If there is a comma between the chain and I want to insert in the last name, first name and middle name
    3. If there is one channel then insert even in first name and last name.

    I wrote the request more early to manage only by commas and now I'm trying but not able to use this all scenarios
    Can you please help me.
    WITH t AS (
     
    select 'Kodali,Raj,S' str from dual
    union 
    select 'Alex Romano' from dual
    union 
    select 'ppppp' from dual
    
    ) 
    select DECODE(trim(a),NULL,'a',trim(a)),DECODE(trim(b),NULL,'b',trim(b)),decode(trim(c),NULL,'c' ,trim(c)) 
    from 
     (
      SELECT max(decode(level,1,regexp_substr(str,'[^,]+',1,level))) a --INTO lFNAME
              , max(decode(level,2,regexp_substr(str,'[^,]+',1,level))) b --INTO lLNAME
              , max(decode(level,3,regexp_substr(str,'[^,]+',1,level))) c --INTO lMNAME       
       FROM   t
      CONNECT BY regexp_substr(str,'[^,]+',1,level) IS NOT NULL
      GROUP BY str
    ) ;
    Currently I put a b and c if its null value.


    Thanks in advance!

    Hello
    You can do what you asked for in pure SQL like this:

    WITH     got_pos          AS
    (
         SELECT     str
         ,     INSTR (str, ',')     AS comma_pos
         ,     INSTR (str, ' ')     AS space_pos
         FROM     t
    )
    SELECT    str
    ,       CASE
               WHEN  comma_pos > 0
               THEN  REGEXP_SUBSTR (str, '\w+', 1, 2)
               WHEN  space_pos > 0
               THEN  SUBSTR (str, 1, space_pos - 1)
               ELSE  str
           END     AS fname
    ,       CASE
              WHEN  comma_pos > 0
              THEN  REGEXP_SUBSTR (str, '\w+', 1, 3)
              ELSE  TRIM (REGEXP_SUBSTR (str, ' \w+ '))
           END     AS mname
    ,       CASE
               WHEN  comma_pos > 0
               THEN  SUBSTR (str, 1, comma_pos - 1)
               ELSE  REGEXP_SUBSTR (str, '\w+$')
           END     AS lname
    FROM       got_pos
    ORDER BY  str
    ;
    

    But look how it is difficult, even for this simple example of data.

    I suggest you write a PL/SQL function to analyze the name. It will be much easier to deal with a combination of spaces and commas, the names of more than 3 words, etc.

  • Need help with the COUNT in a query

    Hi all
    I have the following table. In this table, I try to get the number of records per month when its value (SIGNAGE_ONE_LANE_ROAD_AHEAD) is 'Yes' and gives me the number of fake. Anyone can you please point out where I'm wrong?
    AUDIT_DATE SIGNAGE_ONE_LANE_ROAD_AHEAD SIGNAGE_LANE_CLOSED_AHEAD

    05/01/2011 09:30 N/A N/A
    09/02/2011-11:50 Yes Yes
    21/02/2011-10:00 Yes Yes
    22/02/2011-07:00 N/A N/A
    07/03/2011-13:35 Yes n/a
    08/03/2011 09:15 N/A N/A
    09/03/2011 08:40 N/A N/A
    10/03/2011-10:00 N/A N/A
    11/03/2011 09:45 Yes Yes
    16/03/2011 08:45 Yes n/a
    17/03/2011 09:30 N/A N/A
    17/03/2011 12:05 N/A N/A
    17/03/2011-13:10 Yes n/a
    21/03/2011 10:30 N/A N/A
    22/03/2011 09:30 Yes n/a
    04/04/2011 11:20 Yes Yes
    05/04/2011 10:30 Yes Yes
    05/04/2011-10:45 Yes Yes
    08/04/2011 09:30 Yes Yes
    08/04/2011 12:45 N/A N/A
    13/04/2011 10:15 Yes Yes
    21/04/2011 08:45 N/A N/A
    SELECT   to_char(t.audit_date,'mm') as audit_month, t.signage_lane_closed_ahead,
             t.signage_one_lane_road_ahead,
             (CASE
                 WHEN t.signage_lane_closed_ahead = 'Yes'
                    THEN COUNT (t.signage_lane_closed_ahead)
                 ELSE 0
              END
             ) AS lane_closed_count
        FROM dw_safety_work_zone_audit t
        group by to_char(t.audit_date,'mm'), t.signage_lane_closed_ahead,t.SIGNAGE_ONE_LANE_ROAD_AHEAD
    ORDER BY to_char(t.audit_date,'mm')
    and the DataSet I get is
    AUDIT_MONTH SIGNAGE_LANE_CLOSED_AHEAD SIGNAGE_ONE_LANE_ROAD_AHEAD LANE_CLOSED_COUNT

    S/O S/O 1 0
    S/O S/O 2 0
    Yes Yes 2 2
    3 S/O S/O 0
    3 s/o Yes 0
    3 Yes n/a 3
    3 Yes Yes 1
    4 N/A N/A 0
    4 Yes Yes 5


    Thank you

    Hello

    thinkingeye wrote:

    SELECT   to_char(t.audit_date,'mm') as audit_month, t.signage_lane_closed_ahead,
    t.signage_one_lane_road_ahead,
    (CASE
    WHEN t.signage_lane_closed_ahead = 'Yes'
    THEN COUNT (t.signage_lane_closed_ahead)
    ELSE 0
    END
    ) AS lane_closed_count
    FROM dw_safety_work_zone_audit t
    group by to_char(t.audit_date,'mm'), t.signage_lane_closed_ahead,t.SIGNAGE_ONE_LANE_ROAD_AHEAD
    ORDER BY to_char(t.audit_date,'mm')
    

    You want to COUNT (CASE...), not CASE...

    The above code uses a CASE expression to display 0 or a NUMBER. When he shows the COUNTY, it is the full NUMBER in this column, not something conditional.

    You probably want somehting like:

    ...      COUNT ( CASE
                             WHEN t.signage_lane_closed_ahead = 'Yes'
                         THEN t.signage_lane_closed_ahead
                      END
                )     AS lane_closed_count
    

    In addition, you want to GROUP BY t.singage_lane_closed_ahead? Doing so means that you will get separate lines of output (with separate heads) for the 'Yes' and 'n/a '.

    Also, maybe you should use
    TRUNC (t.audit_date, 'mm') instead of
    To_char (t.audit_date, 'mm')

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

  • need help with the Update statement

    Hello
    I received a question in a course and I tried my best to respond, and now my brain is giving. I would really appreciate help with the update statement. I don't mind if you do not validate a solution, a little nudge in the right direction would be really useful. I'll post that I got.

    THE QUESTION
    / * For these agents disabled on more than seven missions, change their date of deactivation of the first date of deactivation of all the agents that have been activated in the same year as the agent that you update currently.
    */

    I have it divided into parts, here is my select statement to agents disabled on more than 7 missions, which produces the deactivation_dates in the agents table that I want to update...
    SELECT
    s.deactivation_date
    FROM
    (
    SELECT
    a.deactivation_date,
    count(m.mission_id) as nomissions
    FROM
    agents a
    INNER JOIN
    missions_agents m
    on
    a.agent_id=m.agent_id
    GROUP BY
    a.deactivation_date
    ) s
    WHERE
    s.nomissions>7 AND s.deactivation_date IS NOT NULL
    .. .and the code for the first date of deactivation for each year of activation agent
    select 
    a2.deactivation_date
    from
    agents a2
    where a2.deactivation_date= 
    (
    select min(a.deactivation_date)
    from 
    agents a
    where to_number(to_char(a.activation_date,'YYYY'))=to_number(to_char(a2.activation_date,'YYYY'))
    )
    ..... I am not real to marry these two statements together in the Update statement. I can't extract each date of deactivation produced in the first select statement and their match against the first date of deactivation in the year they have been activated for the second select statement.

    Any help greatly appreciated... :))

    I began to wonder how things would :)

    user8695469 wrote:
    First of all why he chooses the date the earliest of all agents

    UPDATE  AGENTS_COPY AC /* (1) */
    SET     DEACTIVATION_DATE = (
    SELECT  MIN(AGS.DEACTIVATION_DATE)
    FROM    AGENTS_COPY  AGS
    ,       AGENTS_COPY AC /* (2) */
    WHERE   TRUNC(AGS.ACTIVATION_DATE,'YEAR') = TRUNC(AC.ACTIVATION_DATE,'YEAR') /* (3) */
    )
    

    He recovers as soon as the subquery has not been correctly set in the SET clause. It seems you are trying to update a correlated, but we are still having a conceptual shift. I have added a few comments to your code above and below will explain.

    (1): when you do a correlated update it is useful to the table alias that you did right here.

    (2): this table statement is not necessary and is the reason why the FIRST deactivation date is selected. The alias that you use (3) refers to THIS table, not the one defined in the update statement. Remove the line indicated by (2) in the FROM clause and a correlated update will happen.

    and secondly why is it to update each row, when I thought that I'm just the lines where the agents are disabled and missions > 7? Pointers on where I'm wrong would be very appreciated. (SQL = stupid query language!) :)

    user8695469 wrote: then why is it to update each row, when I thought that I'm just the lines where the agents are disabled and missions > 7? Pointers on where I'm wrong would be very appreciated. (SQL = stupid query language!) :)

    
    WHERE EXISTS
    (
    SELECT
    a.agent_id,
    count(m.mission_id)
    FROM
    agents a
    /* INNER JOIN AC ON AC.AGENT_ID = A.AGENT_ID */
    INNER JOIN
    missions_agents m
    ON
    a.agent_id=m.agent_id
    GROUP BY
    a.agent_id,
    a.deactivation_date
    HAVING
    count(m.mission_id)>7 AND a.deactivation_date IS NOT NULL
    )
    

    Once again this problem is similar to the question above that a correlation update doesn't work. Test existence of lines in an EXISTS subquery. Since your subquery is not related to the table that you are trying to update, it will be always return a line and, therefore, it returns true for EACH LINE in the AGENTS table. To limit the game to only agents > 7 missions results, you need to add a join condition that references the table in your update statement. I added one above (with comments) as a sample.

    I recommend you look over all material that you have associated with correlated subqueries, including documents that I posted above. This seems to be what you're having the problem more with. If you need me to explain the concept of correlated queries any better please let me know.

    Thank you!

  • Speed/performance of my mac mini (mid-2010) is very slow. Need help, consolidate the files, software updates, etc. in order to improve the speed and performance.

    My mac mini (mid-2010) speed/performance is very slow - think of it as a result of letting my kids do "whatever" about it in recent years.  Need help, consolidate the files, software updates, etc. in order to improve the speed and performance.  You will also need to get data out of old PowerBook G4.

    < object edited by host >

    We are users like you.  Search locally by using something like Yelp or similar

    http://www.Yelp.com/search?find_desc=Apple+repair & find_loc = Chicago, + IT & start = 0 & ortby = rating s

    or read a few links which may be relevant on this forum about the slow mac mini

    http://BFY.tw/5C63

  • How to replace "apply downloaded update now" with "Check for Updates" in the menu help when the update fails because the downloaded update files are missing but the "Ready to install update" window keeps appearing?

    Question

    I have another type of problem with Firefox

    Description

    Window "Ready to Install" Firefox "Software Update" appeared. The folder "C:\Program Files\Mozilla Firefox\updates\0" contained the files update.mar, update.status and update.version. Each of the 3 files have been deleted. The next time that Firefox has been started, no update occurred because update files were missing. In the Menu bar, clicking Help showed in the menu drop-down that "apply downloaded update now" was always on the list. By clicking on "Apply downloaded update now" open "Software Update" window "Ready to install update", so that Firefox still considers that the update files exist, but they do not. In the window "Software Update", by clicking on "Restart Firefox" restart of Firefox, but once again it there's no update, and remains "apply downloaded update now" on the Help menu. How can "Apply downloaded update now" be replaced by "Check for Updates" so the update files can be downloaded?

    Version of Firefox

    3.6.3

    Operating system

    Windows XP

    User Agent

    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; RV:1.9.2.3) Gecko/20100401 Firefox/3.6.3

    Plugins installed

    • npmnqmp - 989898989877
    • NP-mswmp
    • Adobe PDF plugin for Firefox and Netscape "9.3.2.
    • Default plugin
    • Foxit Reader plugin for Firefox and Netscape
    • Shockwave Flash 10.0 r45
    • Version 1.0.3 copyright 1996-2009 The VideoLAN Teamhttp: / /www.videolan.org/

    You can manually reset the software update feature by closing Firefox and remove the file "updates" (which seems you have done) and the two files "active - update.xml" and "updates.xml" - these are in the installation (C:\Program Files\Mozilla Firefox) directory or in the profile folder (C:\Documents and Settings\nom_utilisateur\Application Data\Mozilla\Firefox\Profiles\something.default).

    If it does not, see our KB article How to resolve the failure of the update of Firefox update error message - the section of 'last resort' can be useful, or or read this article from MozillaZine KB, software update.

    Please let us know how the above work, and if we can be of further assistance.

  • recently I formatted my windows XP PC. after update to show that it does not allow the genuine.but when I brought it was authentic. I have the product key with me.Please,help help find the solution

    recently I formatted my windows XP PC. after update to show that it does not allow the genuine.but when I brought it was authentic. I have the product key with me.Please,help help find the solution

    Please visit http://www.microsoft.com/genuine/ and click the Validate Windows button, then restart your computer.

    If you were not able to validate, follow these steps:

    1. Download this diagnostic tool, save it to your desktop: http://go.microsoft.com/fwlink/?linkid=56062

    1B. double-click the executable file to run the tool.

    2. after running the tool, click the Windows tab, and then click copy in the Clipboard.

    NB: You can open a new file in Notepad, paste the contents of the Clipboard in it & keep for future reference.

    3 start a new thread in the following forum and paste the results of the WGA diagnostic data in a post detailing the problem: http://social.microsoft.com/Forums/en-US/genuinewindowsxp/threads

    4 Troubleshooting specialist will analyze the data and recommend an appropriate solution.

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Windows installed the automatic windows update agent and I would appreciate help with the settings option in this newly installed agent update so no update never install or download unless I choose to do.

    Hello.

    I have windows vista 32 bit home edition.

    Today somehow automatically installed windows ' automatic update agent 747600226

    I always keep my settings to check the updates but let me choose whether to update or install.

    With this new "update automatic agent" which automatically installed on my system, I want to make sure I have place it properly so that it remains in the same way that I always have my settings but two settings (options), he checked, and are confusing for me to know what those checked settings will do.

    I would like to help you with these settings to make sure that the update is still as I want.

    Below chose correctly when the new program installed today.  That's how I still want the settings to be:

    Look for updates but let me choose whether to update or install

    Please let me know if I need to change all the options account required in addition to this update agent to ensure that only, I choose to update or install.

    There are four options and a box is in two and I don't know if I should remove the check marks or not.

    Here are the other four options that I need to know how to configure it so that only I have update/install.

    Once again, the download automatic microsoft today (update automatic agent 7.4.7600.226) without asking for my incentive preset automatic update options and that's what I'm trying to make sure is set correctly so that nothing installs or updates without asking me or let me do.

    Option 1: (this option is checked. If I leave it checked will be it install or warn me only?)

    Give me updates recommended in the way I receive important updates.

    Option 2: (this is not checked and am not worried about this one)

    Allow all users to use installed on this pc.

    Option 3:
    (this is checked and want to know if should uncheck; what I don't want is any what to auto install, but the wording of this option and option 1 are vague because of the "give me " so I don't know what it means or will do.)  If this box is left to it automatically update/install?)

    Give me updates for Microsoft products and looking for new optional microsoft software when I update windows

    Option #4 (this is not checked, and I am not concerned about this).

    See the notification me detailed when new microsoft software is available.

    Thank you very much for your help.

    Take care! :)

    Hello

    The Windows Update automatically updates the updater (himself), regardless of your settings.

    1. Yes it will alert you so you can update or install.

    2. check if you need more of yourself (other users) to be able to select and install the updates.

    3. it will let you know when they become available.

    4. just gives the news of additional details about some of the updates.

    Looks like you're ready for anything you like.

    Rob - bicycle - Mark Twain said it is good.

  • With the help of Vista on the laptop. Receive 3 updates on initialize to the top & stop. Do not install. Party at 3 x through process 80070002. How to fix?

    With the help of Vista on the laptop. Receive 3 updates on initialize to the top & stop.  Do not install.  Party at 3 x through process 80070002. How to fix?  3 updates failed to install: KB2779562, KB2705219 and KB2722913.  Constantly configures updates during startup and shutdown.  Takes a long time for the two workers.  Can anyone give advice?

    To decode 0 x 80070002. X 0 means that it is a hexadecimal number, 8 , error, the first 7 means it a windows error and the rest of Eastern 2, the number, the Windows error.
     
    To search for the error message we need to decimal format. Start the Calculator (Start - All Programs - Accessories - calculator) and choose the menu display - scientific, then the menu display - Hex. Enter 2 Menu display - decimal. It will say 2.
     
    Start an command prompt (Start - All Programs - Accessories - command prompt) and type
     
    net helpmsg 2
     
    and it will say
     
    The system cannot find the specified file.
     
    Use Notepad to search for FATAL and 80070002 in C:\Windows\Windowsupdate.log.
  • Need help with the update of Windows (OS-Windows 7)

    Hello world

    Recently, I met a problem with Windows update on my laptop (OS-Windows 7). Everything is fine with it, but when I try to install updates (recommended or optional) window says that it downloads the updates, but the progress remains to 0KB and 0% downloaded status. I tried to restart the service of windows update with utility update of windows running, but without success. However, I was able to install updates, most of them associated with Microsoft.NET framework 3.5.1 (I'm not sure of the version of the .NET Framework is installed in my computer). But when I tried to install other updates updated security windows or .NET Framework 4. XX version update, he gave the same answer that I mentioned above.

    I can give my specifications and other information required if necessary.

    Please help me with this problem about the update of windows.

    Thanks for your time and your help.

    Try the following: set never 'Find updates' automatic updates and then restart Windows. Download and install KB3161608.

    http://support.Microsoft.com/kb/3161608

    Best regards, VZ

  • Help please! ... No UPDATE of VICTORY since * 2011 *! Win 7, 32 bit, the ASUS Eee netbook

    Hello world

    I know some basics, but can't seem to understand this one!

    ASUS Eee PC 1011PX, Intel Atom N570, Windows Starter, Service Pack 1, 32-bit, @1. 66 GHz 1.67 GHz, 1 GB ram... (netbook)

    Does not at all, update... .last updated 2011!

    Sitting in an office that is not used for 3 years.

    Says "updates more recent audit for 2014' and the last installed 2011." .... 134 important updates available (409,7 MB).

    Said to Windows is activated, and the general system is ok...

    * (slow system, but it was always like that because only 1 GB of ram, or so that's my guess)

    As a first step:

    I have re-uploaded (free editions of their sites) Ccleaner, Malwarebytes, and Superantispyware... then double checked versions for my 2 other laptops (HP win8 and an even older Acer with Vista) where I have these 3 tools also.

    Updated program of Avast and definitions.

    * has no re - download Avast *.

    CCleaner.

    -scan analysed then main to remove.

    -analysis of the registry. says it fixes stuff, but I note he's sorry.

    Malw.

    -hyper scan

    -analysis of the threat. found a few away from browser... wjam/yahoo stuff and a few others.

    Superantisp.

    -analysis of critical points. Ok

    -quick scan. typical minor stuff, nothing to note.

    -full scan. even

    Avast.

    -smart scan

    -quick scan. Ok

    -full scan. Ok

    -Start scan. Ok

    -After above scans, always had prob, so I changed to high sensitivities/heuristics, and made sure that all of the scans scanned all drives including system and rootkits player... then back above scans.

    I tried Microsoft Fixit suggested troubleshooting tool... said it fixed 1 corrupted registry.

    ++ FINALLY ++ Rebooted in safe MODE and above repeated scans. (with the exception of Avast, it is not designed for safe mode more)

    ALL OF THESE PROCEDURES WAS NOT ABLE TO REPAIR WINDOWS UPDATE :(

    * Maybe I have to investigate my diary of the events/spectator, looking for the exact time that it update?

    * Maybe tweaking avancΘs (which I do not fully understand)... and create analyses in all of the above tools?

    * I don't have any method of restoration again, but do not know if it is available as too far behind. AND I have no boot disks/Win to start to update my system.

    Help, please!

    See you soon,.

    -

    Have you tried:

    https://support.Microsoft.com/en-us/KB/971058

    Automatically reset the Windows Update components.  There is also a very detailed manual procedure there that looks like it could help.  It's not clear no dialogue on this page that the automatic procedure does the same thing.  Worth a try!

  • Help the clean installation of Windows 7 Pro and using the GPO to run automatic updates and restart all night

    I am trying to solve a problem that will probably require a new installation of Windows 7 Professional 64-bit. The grace period ends in 3 days, and the next 30 days are final exams at the College. I have 2 licenses (and product key) of Windows 7 Pro, but my drive HARD goes wrong and I don't want to use MAK activation. I will be eventually to replace the disk, but is now bad timing.

    If a reinstall is needed, I was going to ask if anyone knows how to set the strategy of perhaps a GPO where Windows is updated automatically in the background and after installing updates, 45 or 60 minutes, then restart. The goal would be to have a computer fully patched when I wake up in the morning.

    This is my plan:

    Install Windows 7 Pro SP1 64 bit > Windows automatically updated and plug the Ethernet cable > define a GPO where the computer waiting for 45 to 60 minutes after installation of updates (so the msi may end in the background, and I do not interrupt the installation) > the PC will restart > more update swill be downloaded and installed > wait due to the policy of GPO before reboot > Reboot > do it until it's over. > wake up with a PC fully patched 7-9 hours later.

    Is this a workable plan?, and if so, how do I define policies such as delay restarting, etc. to achieve?

    The reset did not work. It would be a simple solution. I have a valid license, but I don't want to replace the HARD drive until after final exams are over, so I'll reinstall and activate. I try to achieve in the next 24 hours, so it doesn't keep me from my school work.  I must also support and will then replace my files.

    Feel free to advanced used terminology. I have some experience.

    Any help is greatly appreciated!

    Another question: should I install a security suite before all updates being installed more than 12 hours, or wait until later? What is the level of risk?

    Anyone used Ninite to automate the installation of other programs? Is how safe it?

    Thank you!

    You will have to go on Support of Windows 7 forums on the following link to help solve your problem: http://social.technet.microsoft.com/Forums/en/category/w7itpro/

  • After you have reinstalled my old CS6 Design Standard on a new Mac Pro I can't use the updates in help. I only receive offers on update creative Cloud applications. I don't have any application of CC. How to find updates for my applications CS6?

    After you have reinstalled my old CS6 Design Standard on a new Mac Pro I can't use the updates in help. I only receive offers on update creative Cloud applications. I don't have any application of CC. How to find updates for my applications CS6?

    Beginning of the updates here and product selection, read to see if you need to install updates in the order of the numbers, or if updates are cumulative for the product http://www.adobe.com/downloads/updates/

Maybe you are looking for

  • Why won't my home page to the default?

    For some reason my home page is Google, but I want it to be simply the default Start Page of Mozilla. Whenever I have change to default that it goes back to Google. It does not have the default home page, which is what I want.

  • Satellite Pro A10 display and DVD issues

    I have a Satellite Pro A10 about 2 1/2 years and have never had a problem with him, but the other day when I tried to watch a DVD, look at a program (InterActual Player) opened as usual and then a few more seconds later the display will change in ver

  • Product name: HP AC116 TX 15: Wi - Fi limited

  • Satellite L500-12 q - change or replace the graphics card

    Hey guys I'm new in this placeCould someone change or replace the graphics card on Satellite L500-12 q with a better game card? I searched the Web for a better card, but couldn't find any info on my laptop with the exception of increasing the perform

  • On the mac does not... and Brother printer does not print

    I think this goes back to my installation of El Capitan, but I'm not entirely sure. I do not use my iMac very strongly, as it was purchased as a family computer to replace one another iMac which was about 8-10 years of age and just couldn't keep up w