Very Slow Query due to Bitmap Conversion

I have a strange problem with the performance of a spatial query. If I perform a 'SELECT non_geom_column FROM my_table WHERE complicated_join_query' the result comes back sub-second. However, when I replace the column selected with geometry and perform 'SELECT geom_column FROM my_table WHERE same_complicated_join_query' the response takes over a minute.
The issue is that in the second case, despite the identical where clause, the explain plan is significantly different. In the 'select geom_column' query there is a BITMAP CONVERSION (TO ROWIDS) which accounts for all of the extra time, where as in the 'select other_column' query that conversion is replaced with TABLE ACCESS (BY INDEX ROWID) which is near instant.
I have tried putting in some hints, although I do not have much experience with hints, and have also tried nesting the query in various sub-selects. Whatever I try I can not persuade the explain plan to drop the bitmap conversion when I select the geometry column. The full query and an explanation of that query are below. I have run out of things to try, so any help or suggestions at all would be much appreciated.
Regards,
Chris
Explanation and query
My application allows users to select geometries from a map image through clicking, dragging a box and various other means. The image is then refreshed - highlighting geometries based on the query with which I am having trouble. The user is then able to deselect any of those highlighted geometries, or append others with additional clicks or dragged selections.
If there are 2 (or any even number of) clicks within the same geometry then that geometry is deselected. Alternatively the geometry could have been selected through an intersection with a dragged box, and then clicked in to deselect - again an even number of selections. Any odd number of selections (i.e. selecting, deselecting, then selecting again) would result in the geometry being selected.
The application can not know if the multiple user clicks are in the same geometry, as it simply has an image to work with, so all it does is pass all the clicks so far to the database to deal with.
My query therefore does each spatial point or rectangle query in turn and then appends the unique key for the rows each returned to a list. After performing all of the queries it groups the list by the key and the groups with an odd total are 'selected'. To do this logic in a single where clause I have ended up with nested select statements that are joined with union all commands.
The query is therefore..
SELECT
--the below column (geometry) makes it very slow...replacing it with any non-spatial column takes less than 1/100 of the time - that is my problem!
geometry
FROM
my_table
WHERE
primary_key IN
SELECT primary_key FROM
SELECT primary_key FROM my_table WHERE
sdo_relate(geometry, mdsys.sdo_geometry(2003, 81989, NULL, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array( rectangle co-ords )), 'mask=anyinteract') = 'TRUE'
UNION ALL SELECT primary_key FROM my_table WHERE
sdo_relate(geometry, mdsys.sdo_geometry(2001, 81989, sdo_point_type( point co-ords , NULL), NULL, NULL), 'mask=anyinteract') = 'TRUE'
--potentially more 'union all select...' here
GROUP BY primary_key HAVING mod(count(*),2) = 1     
AND
--the below is the bounding rectangle of the whole image to be returned
sdo_filter(geometry, mdsys.sdo_geometry(2003, 81989, NULL, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array( outer rectangle co-ords )), 'mask=anyinteract') = 'TRUE'

Hi
Thanks for the reply. After a lot more googling- it turns out this is a general Oracle problem and is not solely related to use of the GEOMETRY column. It seems that sometimes, the Oracle optimiser makes an arbitrary decision to do bitmap conversion. No amount of hints will get it to change its mind !
One person reported a similarly negative change after table statistic collection had run.
Why changing the columns being retrieved should change the execution path, I do not know.
We have a numeric primary key which is always set to a positive value. When I added "AND primary_key_column > 0" (a pretty pointless clause) the optimiser changed the way it works and we got it working fast again.
Chris

Similar Messages

  • Very slow boot due to USB controller?

    Hi all,
    I bought your barebone MS-6251 with combo DVD-RW. (other params are pentium IV 2.8 GHz, 512 MB RAM, 120 GB HDD Seagate, NVIDIA GeForce FX 5200 Ultra). I already installed your LiveUpdate software.
    I was absolutely satisfied with this product untill this monday (or tuesday) when my computer suddenly crashed. From that time I was not able to boot it again up, it froze after login dialog of Windows completely.
    I reinstalled windows again and I was succesful and now I am working on the computer but I have following problems:
    1. I am not able to install in windows FRONT PANEL with card readers?
    2. During start up of Windows, they seems to stop for 1 minute - black screen, HDD not operating, after this long 1 minute start up process continues normally.
    3. I noticed that it is somehow connected with USB controller - when I switch it off in BIOS, everything runs quickly - of course without USB support. Immediately as I switch it on, there is this huge delay during start up.BUT THIS WAS NOT BEFORE - BEFORE CRASH MY WINDOWS STARTED IN 10 SECONDS. If I switch moreover to enable  KEYBOARD SUPPORT (USB) or MOUSE SUPPORT (USB) in bios, the delay is really catastrofic - it takes 1-2 minutes for the initial MEGAPC screen to go away and then another 1-2 minutes starting windows.
    I checked my BIOS version, it was 1.0, so I tried to update to 1.1 but it is the same.
    This is very annoying, I believe that you have some solution for me, otherwise I will have to return computer to my supplier.
    Many thanks for you help and nice day
    Vladimir Buzalka
    Czech Republic

    Hi
    Thanks for the reply. After a lot more googling- it turns out this is a general Oracle problem and is not solely related to use of the GEOMETRY column. It seems that sometimes, the Oracle optimiser makes an arbitrary decision to do bitmap conversion. No amount of hints will get it to change its mind !
    One person reported a similarly negative change after table statistic collection had run.
    Why changing the columns being retrieved should change the execution path, I do not know.
    We have a numeric primary key which is always set to a positive value. When I added "AND primary_key_column > 0" (a pretty pointless clause) the optimiser changed the way it works and we got it working fast again.
    Chris

  • Very Slow Query with CTE inner join

    I have 2 tables (heavily simplified here to show relevant columns):
    CREATE TABLE tblCharge
    (ChargeID int NOT NULL,
    ParentChargeID int NULL,
    ChargeName varchar(200) NULL)
    CREATE TABLE tblChargeShare
    (ChargeShareID int NOT NULL,
    ChargeID int NOT NULL,
    TotalAmount money NOT NULL,
    TaxAmount money NULL,
    DiscountAmount money NULL,
    CustomerID int NOT NULL,
    ChargeShareStatusID int NOT NULL)
    I have a very basic View to Join them:
    CREATE VIEW vwBASEChargeShareRelation as
    Select c.ChargeID, ParentChargeID, s.CustomerID, s.TotalAmount, isnull(s.TaxAmount, 0) as TaxAmount, isnull(s.DiscountAmount, 0) as DiscountAmount
    from tblCharge c inner join tblChargeShare s
    on c.ChargeID = s.ChargeID Where s.ChargeShareStatusID < 3
    GO
    I then have a view containing a CTE to get the children of the Parent Charge:
    ALTER VIEW [vwChargeShareSubCharges] AS
    WITH RCTE AS
    SELECT ParentChargeId, ChargeID, 1 AS Lvl, ISNULL(TotalAmount, 0) as TotalAmount, ISNULL(TaxAmount, 0) as TaxAmount,
    ISNULL(DiscountAmount, 0) as DiscountAmount, CustomerID, ChargeID as MasterChargeID
    FROM vwBASEChargeShareRelation Where ParentChargeID is NULL
    UNION ALL
    SELECT rh.ParentChargeID, rh.ChargeID, Lvl+1 AS Lvl, ISNULL(rh.TotalAmount, 0), ISNULL(rh.TaxAmount, 0), ISNULL(rh.DiscountAmount, 0) , rh.CustomerID
    , rc.MasterChargeID
    FROM vwBASEChargeShareRelation rh
    INNER JOIN RCTE rc ON rh.PArentChargeID = rc.ChargeID and rh.CustomerID = rc.CustomerID
    Select MasterChargeID as ChargeID, CustomerID, Sum(TotalAmount) as TotalCharged, Sum(TaxAmount) as TotalTax, Sum(DiscountAmount) as TotalDiscount
    from RCTE
    Group by MasterChargeID, CustomerID
    GO
    So far so good, I can query this view and get the total cost for a line item including all children.
    The problem occurs when I join this table. The query:
    Select t.* from vwChargeShareSubCharges t
    inner join
    tblChargeShare s
    on t.CustomerID = s.CustomerID
    and t.MasterChargeID = s.ChargeID
    Where s.ChargeID = 1291094
    Takes around 30 ms to return a result (tblCharge and Charge Share have around 3.5 million records).
    But the query:
    Select t.* from vwChargeShareSubCharges t
    inner join
    tblChargeShare s
    on t.CustomerID = s.CustomerID
    and t.MasterChargeID = s.ChargeID
    Where InvoiceID = 1045854
    Takes around 2 minutes to return a result - even though the only charge with that InvoiceID is the same charge as the one used in the previous query.
    The same thing occurs if I do the join in the same query that the CTE is defined in.
    I ran the execution plan for each query. The first (fast) query looks like this:
    The second(slow) query looks like this:
    I am at a loss, and my skills at decoding execution plans to resolve this are lacking.
    I have separate indexes on tblCharge.ChargeID, tblCharge.ParentChargeID, tblChargeShare.ChargeID, tblChargeShare.InvoiceID, tblChargeShare.ChargeShareStatusID
    Any ideas? Tested on SQL 2008R2 and SQL 2012

    >> The database is linked [sic] to an established app and the column and table names can't be changed. <<
    Link? That is a term from pointer chains and network databases, not SQL. I will guess that means the app came back in the old pre-RDBMS days and you are screwed. 
    >> I am not too worried about the money field [sic], this is used for money and money based calculations so the precision and rounding are acceptable at this level. <<
    Field is a COBOL concept; columns are totally different. MONEY is how Sybase mimics the PICTURE clause that puts currency signs, commas, period, etc in a COBOL money field. 
    Using more than one operation (multiplication or division) on money columns will produce severe rounding errors. A simple way to visualize money arithmetic is to place a ROUND() function calls after 
    every operation. For example,
    Amount = (Portion / total_amt) * gross_amt
    can be rewritten using money arithmetic as:
    Amount = ROUND(ROUND(Portion/total_amt, 4) * 
    gross_amt, 4)
    Rounding to four decimal places might not seem an 
    issue, until the numbers you are using are greater 
    than 10,000. 
    BEGIN
    DECLARE @gross_amt MONEY,
     @total_amt MONEY,
     @my_part MONEY,
     @money_result MONEY,
     @float_result FLOAT,
     @all_floats FLOAT;
     SET @gross_amt = 55294.72;
     SET @total_amt = 7328.75;
     SET @my_part = 1793.33;
     SET @money_result = (@my_part / @total_amt) * 
    @gross_amt;
     SET @float_result = (@my_part / @total_amt) * 
    @gross_amt;
     SET @Retult3 = (CAST(@my_part AS FLOAT)
     / CAST( @total_amt AS FLOAT))
     * CAST(FLOAT, @gross_amt AS FLOAT);
     SELECT @money_result, @float_result, @all_floats;
    END;
    @money_result = 13525.09 -- incorrect
    @float_result = 13525.0885 -- incorrect
    @all_floats = 13530.5038673171 -- correct, with a -
    5.42 error 
    >> The keys are ChargeID(int, identity) and ChargeShareID(int, identity). <<
    Sorry, but IDENTITY is not relational and cannot be a key by definition. But it sure works just like a record number in your old COBOL file system. 
    >> .. these need to be int so that they are assigned by the database and unique. <<
    No, the data type of a key is not determined by physical storage, but by logical design. IDENTITY is the number of a parking space in a garage; a VIN is how you identify the automobile. 
    >> What would you recommend I use as keys? <<
    I do not know. I have no specs and without that, I cannot pull a Kabbalah number from the hardware. Your magic numbers can identify Squids, Automobile or Lady Gaga! I would ask the accounting department how they identify a charge. 
    >> Charge_Share_Status_ID links [sic] to another table which contains the name, formatting [sic] and other information [sic] or a charge share's status, so it is both an Id and a status. <<
    More pointer chains! Formatting? Unh? In RDBMS, we use a tiered architecture. That means display formatting is in a presentation layer. A properly created table has cohesion – it does one and only one data element. A status is a state of being that applies
    to an entity over a period time (think employment, marriage, etc. status if that is too abstract). 
    An identifier is based on the Law of Identity from formal logic “To be is to be something in particular” or “A is A” informally. There is no entity here! The Charge_Share_Status table should have the encoded values for a status and perhaps a description if
    they are unclear. If the list of values is clear, short and static, then use a CHECK() constraint. 
    On a scale from 1 to 10, what color is your favorite letter of the alphabet? Yes, this is literally that silly and wrong. 
    >> I understand what a CTE is; is there a better way to sum all children for a parent hierarchy? <<
    There are many ways to represent a tree or hierarchy in SQL.  This is called an adjacency list model and it looks like this:
    CREATE TABLE OrgChart 
    (emp_name CHAR(10) NOT NULL PRIMARY KEY, 
     boss_emp_name CHAR(10) REFERENCES OrgChart(emp_name), 
     salary_amt DECIMAL(6,2) DEFAULT 100.00 NOT NULL,
     << horrible cycle constraints >>);
    OrgChart 
    emp_name  boss_emp_name  salary_amt 
    ==============================
    'Albert'    NULL    1000.00
    'Bert'    'Albert'   900.00
    'Chuck'   'Albert'   900.00
    'Donna'   'Chuck'    800.00
    'Eddie'   'Chuck'    700.00
    'Fred'    'Chuck'    600.00
    This approach will wind up with really ugly code -- CTEs hiding recursive procedures, horrible cycle prevention code, etc.  The root of your problem is not knowing that rows are not records, that SQL uses sets and trying to fake pointer chains with some
    vague, magical non-relational "id".  
    This matches the way we did it in old file systems with pointer chains.  Non-RDBMS programmers are comfortable with it because it looks familiar -- it looks like records and not rows.  
    Another way of representing trees is to show them as nested sets. 
    Since SQL is a set oriented language, this is a better model than the usual adjacency list approach you see in most text books. Let us define a simple OrgChart table like this.
    CREATE TABLE OrgChart 
    (emp_name CHAR(10) NOT NULL PRIMARY KEY, 
     lft INTEGER NOT NULL UNIQUE CHECK (lft > 0), 
     rgt INTEGER NOT NULL UNIQUE CHECK (rgt > 1),
      CONSTRAINT order_okay CHECK (lft < rgt));
    OrgChart 
    emp_name         lft rgt 
    ======================
    'Albert'      1   12 
    'Bert'        2    3 
    'Chuck'       4   11 
    'Donna'       5    6 
    'Eddie'       7    8 
    'Fred'        9   10 
    The (lft, rgt) pairs are like tags in a mark-up language, or parens in algebra, BEGIN-END blocks in Algol-family programming languages, etc. -- they bracket a sub-set.  This is a set-oriented approach to trees in a set-oriented language. 
    The organizational chart would look like this as a directed graph:
                Albert (1, 12)
        Bert (2, 3)    Chuck (4, 11)
                       /    |   \
                     /      |     \
                   /        |       \
                 /          |         \
            Donna (5, 6) Eddie (7, 8) Fred (9, 10)
    The adjacency list table is denormalized in several ways. We are modeling both the Personnel and the Organizational chart in one table. But for the sake of saving space, pretend that the names are job titles and that we have another table which describes the
    Personnel that hold those positions.
    Another problem with the adjacency list model is that the boss_emp_name and employee columns are the same kind of thing (i.e. identifiers of personnel), and therefore should be shown in only one column in a normalized table.  To prove that this is not
    normalized, assume that "Chuck" changes his name to "Charles"; you have to change his name in both columns and several places. The defining characteristic of a normalized table is that you have one fact, one place, one time.
    The final problem is that the adjacency list model does not model subordination. Authority flows downhill in a hierarchy, but If I fire Chuck, I disconnect all of his subordinates from Albert. There are situations (i.e. water pipes) where this is true, but
    that is not the expected situation in this case.
    To show a tree as nested sets, replace the nodes with ovals, and then nest subordinate ovals inside each other. The root will be the largest oval and will contain every other node.  The leaf nodes will be the innermost ovals with nothing else inside them
    and the nesting will show the hierarchical relationship. The (lft, rgt) columns (I cannot use the reserved words LEFT and RIGHT in SQL) are what show the nesting. This is like XML, HTML or parentheses. 
    At this point, the boss_emp_name column is both redundant and denormalized, so it can be dropped. Also, note that the tree structure can be kept in one table and all the information about a node can be put in a second table and they can be joined on employee
    number for queries.
    To convert the graph into a nested sets model think of a little worm crawling along the tree. The worm starts at the top, the root, makes a complete trip around the tree. When he comes to a node, he puts a number in the cell on the side that he is visiting
    and increments his counter.  Each node will get two numbers, one of the right side and one for the left. Computer Science majors will recognize this as a modified preorder tree traversal algorithm. Finally, drop the unneeded OrgChart.boss_emp_name column
    which used to represent the edges of a graph.
    This has some predictable results that we can use for building queries.  The root is always (left = 1, right = 2 * (SELECT COUNT(*) FROM TreeTable)); leaf nodes always have (left + 1 = right); subtrees are defined by the BETWEEN predicate; etc. Here are
    two common queries which can be used to build others:
    1. An employee and all their Supervisors, no matter how deep the tree.
     SELECT O2.*
       FROM OrgChart AS O1, OrgChart AS O2
      WHERE O1.lft BETWEEN O2.lft AND O2.rgt
        AND O1.emp_name = :in_emp_name;
    2. The employee and all their subordinates. There is a nice symmetry here.
     SELECT O1.*
       FROM OrgChart AS O1, OrgChart AS O2
      WHERE O1.lft BETWEEN O2.lft AND O2.rgt
        AND O2.emp_name = :in_emp_name;
    3. Add a GROUP BY and aggregate functions to these basic queries and you have hierarchical reports. For example, the total salaries which each employee controls:
     SELECT O2.emp_name, SUM(S1.salary_amt)
       FROM OrgChart AS O1, OrgChart AS O2,
            Salaries AS S1
      WHERE O1.lft BETWEEN O2.lft AND O2.rgt
        AND S1.emp_name = O2.emp_name 
       GROUP BY O2.emp_name;
    4. To find the level and the size of the subtree rooted at each emp_name, so you can print the tree as an indented listing. 
    SELECT O1.emp_name, 
       SUM(CASE WHEN O2.lft BETWEEN O1.lft AND O1.rgt 
       THEN O2.sale_amt ELSE 0.00 END) AS sale_amt_tot,
       SUM(CASE WHEN O2.lft BETWEEN O1.lft AND O1.rgt 
       THEN 1 ELSE 0 END) AS subtree_size,
       SUM(CASE WHEN O1.lft BETWEEN O2.lft AND O2.rgt
       THEN 1 ELSE 0 END) AS lvl
      FROM OrgChart AS O1, OrgChart AS O2
     GROUP BY O1.emp_name;
    5. The nested set model has an implied ordering of siblings which the adjacency list model does not. To insert a new node, G1, under part G.  We can insert one node at a time like this:
    BEGIN ATOMIC
    DECLARE rightmost_spread INTEGER;
    SET rightmost_spread 
        = (SELECT rgt 
             FROM Frammis 
            WHERE part = 'G');
    UPDATE Frammis
       SET lft = CASE WHEN lft > rightmost_spread
                      THEN lft + 2
                      ELSE lft END,
           rgt = CASE WHEN rgt >= rightmost_spread
                      THEN rgt + 2
                      ELSE rgt END
     WHERE rgt >= rightmost_spread;
     INSERT INTO Frammis (part, lft, rgt)
     VALUES ('G1', rightmost_spread, (rightmost_spread + 1));
     COMMIT WORK;
    END;
    The idea is to spread the (lft, rgt) numbers after the youngest child of the parent, G in this case, over by two to make room for the new addition, G1.  This procedure will add the new node to the rightmost child position, which helps to preserve the idea
    of an age order among the siblings.
    6. To convert a nested sets model into an adjacency list model:
    SELECT B.emp_name AS boss_emp_name, E.emp_name
      FROM OrgChart AS E
           LEFT OUTER JOIN
           OrgChart AS B
           ON B.lft
              = (SELECT MAX(lft)
                   FROM OrgChart AS S
                  WHERE E.lft > S.lft
                    AND E.lft < S.rgt);
    7. To find the immediate parent of a node: 
    SELECT MAX(P2.lft), MIN(P2.rgt)
      FROM Personnel AS P1, Personnel AS P2
     WHERE P1.lft BETWEEN P2.lft AND P2.rgt 
       AND P1.emp_name = @my_emp_name;
    I have a book on TREES & HIERARCHIES IN SQL which you can get at Amazon.com right now. It has a lot of other programming idioms for nested sets, like levels, structural comparisons, re-arrangement procedures, etc. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Stuck on how to improve very slow query without any admin rights

    Hello All,
    I am using the code below to query a very large data table (RH) and a few other joined tables. I am trying to improve the query but I do not have any admin rights and have no idea how to get diagnostic info on how the query is being executed. Apologies for the system specific and probably not easy to read code but I do not have a generic version that anyone could run, and no admin rights so I can not create tables.
    The main part of the code below (subquery R) takes about 10 minutes to run (3 minutes without the date parameters) and the full code (with the two analytic functions on top) below takes an eye watering 30 minutes to run and this is only a subquery of a much larger query so I really need to get this running more quickly. All I want to do is place a cap on the dates, get partitioned row numbers and a lead row value on one of the fields. I really am stuck on how to get this query more efficient. Am I counting things multiple times unnecessarily? How can I make this quicker? Am I committing some cardinal programming sin in using analytic functions on subqueries?
    Apologies for the vaugueness of this code and my questions but I am totally clueless about diagnostics and basically have very limited system access so I'm stuck as to where to go or to look.
    Very grateful for any advice,
    Jon
    SELECT R.*
    , ROW_NUMBER( ) OVER( PARTITION BY R.RTBLE_ID ORDER BY R.EFF_DT DESC, R.CHG_DT DESC ) RN
    , LEAD(R.RTNG_CD,1,0) OVER( PARTITION BY R.RTBLE_ID ORDER BY R.EFF_DT DESC, R.CHG_DT DESC ) RTNG_CD_PREV
    FROM ( SELECT RH.RTNG_ID
    , RH.RTBLE_ID
    , RA.RTNG_ACTN_DESC
    , TYP.RTNG_TYP_DESC
    , RH.RTNG_CD_ID
    , RC.RTNG_CD
    , RH.EFF_DT
    , RH.CHG_DT
    , RAL.RTNG_ALRT_TYP_ID
    , RAL.EFF_DT ALRT_EFF_DT
    , RAL.CHG_DT ALRT_CHG_DT
    , RH.PRV_FLG
    FROM FTCH_RTNG.RTNG_HIST RH
    , FTCH_RTNG.RTNG_ALRT_HIST RAL
    , FII_CORE.RTNG_ACTN RA
    , FTCH_RTNG.RTNG_TYP TYP
    , FII_CORE.RTNG_CD RC
    WHERE RH.RTNG_ACTN_ID = RA.RTNG_ACTN_ID
    AND RH.RTNG_TYP_ID = TYP.RTNG_TYP_ID
    AND RH.RTNG_TYP_ID = RC.RTNG_TYP_ID
    AND RH.RTNG_CD_ID = RC.RTNG_CD_ID
    AND RH.RTNG_ID = RAL.RTNG_ID (+)
    AND RH.DELETE_FLG = 'N'
    AND RH.EFF_DT < TRUNC(CURRENT_DATE,'MM')
    AND RAL.EFF_DT < TRUNC(CURRENT_DATE,'MM')
    )R
    -----

    Thanks so much for replying blueforg, and for pointing out the code markup.
    Our server is in the US and we run our code from London, so it is the local time I am interested in, CURRENT_DATE is merely there to get that and as you suggest is not a column. I want my cap to the first of whatever month I run the code on so I'm happy with that bit of the code (so 1 Oct if I run it today). I'm just surprised at how slow my code becomes when I try and restrict the dates and get the row numbers and next row values.
    This code is actually a subquery used in a much bigger query that I am trying to tidy up and make more efficient. The RN is important as I will eventually be filtering for RN = 1. I didn't post the full query as it is huge,badly written (by me) and and particular to our databases so I'm tackling bits one at a time to cut down on confusion. I'll repost with the RN=1 and the code markup ;)
    I also restricting the RH table directly (SELECT * FROM FTCH_RTNG.RTNG_HIST RH WHERE RH.EFF_DT < TRUNC(CURRENT_DATE,'MM')) and moving the analytic functions into the R subquery but that is very slow as well. I heard that temporary tables are efficient? I'm assuming that with my rubbish priveleges I will not be able to do that. I don't want to take any chances of messing anything up either!
    Jon
    SELECT RT.* FROM
      ( SELECT  R.*
              , ROW_NUMBER( ) OVER( PARTITION BY R.RTBLE_ID ORDER BY R.EFF_DT DESC, R.CHG_DT DESC ) RN    
              , LEAD(R.RTNG_CD,1,0) OVER( PARTITION BY R.RTBLE_ID ORDER BY R.EFF_DT DESC, R.CHG_DT DESC ) RTNG_CD_PREV
        FROM  ( SELECT  RH.RTNG_ID    
                      , RH.RTBLE_ID    
                      , RA.RTNG_ACTN_DESC    
                      , TYP.RTNG_TYP_DESC    
                      , RH.RTNG_CD_ID    
                      , RC.RTNG_CD    
                      , RH.EFF_DT  
                      , RH.CHG_DT 
                      , RAL.RTNG_ALRT_TYP_ID    
                      , RAL.EFF_DT ALRT_EFF_DT    
                      , RAL.CHG_DT ALRT_CHG_DT
                      , RH.PRV_FLG    
                FROM    FTCH_RTNG.RTNG_HIST RH
                      , FTCH_RTNG.RTNG_ALRT_HIST RAL
                      , FII_CORE.RTNG_ACTN RA    
                      , FTCH_RTNG.RTNG_TYP TYP    
                      , FII_CORE.RTNG_CD RC    
                WHERE RH.RTNG_ACTN_ID = RA.RTNG_ACTN_ID    
                AND RH.RTNG_TYP_ID = TYP.RTNG_TYP_ID    
                AND RH.RTNG_TYP_ID = RC.RTNG_TYP_ID    
                AND RH.RTNG_CD_ID = RC.RTNG_CD_ID    
                AND RH.RTNG_ID = RAL.RTNG_ID (+)    
                AND RH.DELETE_FLG = 'N'
                AND RH.EFF_DT < TRUNC(CURRENT_DATE,'MM')
                AND RAL.EFF_DT < TRUNC(CURRENT_DATE,'MM')
                                                          )R  )RT
    WHERE RT.RN = 1-----

  • Very slow query on xml db objects

    Hi, I'm a dba (new to xml db) trying to diagnose some very slow queries against xml tables. The following takes 2 + hours to return a count of ~700,000 records. We have some that take 10-15 hours.
    select count(*)
    from MEDTRONICCRM a, table(xmlsequence(extract(value(a),'/MedtronicCRM/Counters/
    Histogram'))) b ,
    table(xmlsequence(extract(value(b),'/Histogram/Row'))) c, table(xmlsequence(extract(value(c),'/Row/Column'))) d
    The explain plan from a tkprof looks like this:
    Rows Row Source Operation
    1 SORT AGGREGATE (cr=1586294 r=27724 w=0 time=334399181 us)
    761020 NESTED LOOPS (cr=1586294 r=27724 w=0 time=6285597846 us)
    209395 NESTED LOOPS (cr=1586294 r=27724 w=0 time=1294406875 us)
    16864 NESTED LOOPS (cr=1586294 r=27724 w=0 time=188247898 us)
    544 TABLE ACCESS FULL OBJ#(26985) (cr=1993 r=548 w=0 time=171380 us)
    16864 COLLECTION ITERATOR PICKLER FETCH (cr=0 r=0 w=0 time=82831582 us)
    209395 COLLECTION ITERATOR PICKLER FETCH (cr=0 r=0 w=0 time=939691917 us)
    761020 COLLECTION ITERATOR PICKLER FETCH (cr=0 r=0 w=0 time=3399611143 us)
    I noticed the following statemnt in a previous thread:
    "Indexing is not the answer here... The problem is the storage model. You are current storing all of the collections as serialized lobs. This means that all manipluation of the collection is done in memory. We need to store the collections as nested tables to get peformant queries on them. You do this by using the store VARRAY as table clause to control which collections are stored as nested tables. "
    Could this be the problem? How do I tell which storage model we are using.
    Thanks ,
    Heath Henjum

    With 10g I get the following
    SQL> begin
    2 dbms_xmlschema.registerSchema
    3 (
    4 schemaURL => '&3',
    5 schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
    6 local => TRUE,
    7 genTypes => TRUE,
    8 genBean => FALSE,
    9 genTables => &5
    10 );
    11 end;
    12 /
    old 4: schemaURL => '&3',
    new 4: schemaURL => 'MedtronicCRM.xsd',
    old 5: schemaDoc => xdbURIType('/home/&1/xsd/&4').getClob(),
    new 5: schemaDoc => xdbURIType('/home/OTNTEST/xsd/MedtronicCRM.xsd').getClob(),
    old 9: genTables => &5
    new 9: genTables => TRUE
    begin
    ERROR at line 1:
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00175: a complex base within "simpleContent" must have simple content
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 17
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 26
    ORA-06512: at line 2
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options

  • VERY slow email due to Apple adding ridiculous amounts of html to my email signatures behind the scenes

    I've been having trouble with my computers recently because they are running REALLY slowly and I just couldn't figure it out. I went in the Apple store and they said a hard drive re-boot might be the answer and needless to say I've been putting that off.
    Then I got an email from my web guy to say that my email sig was slowing his computer down(!!) and I needed to change the email signature.
    Now, I have my email signature set up so that it includes the relevant info that I want included so I don't want to delete them BUT I do want them to not be slowing things down.
    I asked him what he meant and here is the code that just one of my email signatures is generating and all I've done is set it up to look nice in the mac mail preferences panel.
    Any ideas on how I can solve this and make it still look nice but not have crazy slowing code would be much welcomed!
    Thank you :)
    Sophie
    For reference here’s a chunk of the code...
    <div apple-content-edited=3D"true">
    <div style=3D"color: rgb(0, 0, 0); letter-spacing: normal; orphans: =
    auto; text-align: start; text-indent: 0px; text-transform: none; =
    white-space: normal; widows: auto; word-spacing: 0px; =
    -webkit-text-stroke-width: 0px; word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div =
    style=3D"color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; =
    text-align: start; text-indent: 0px; text-transform: none; white-space: =
    normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
    word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><div style=3D"color: rgb(0, 0, 0); letter-spacing: =
    normal; orphans: auto; text-align: start; text-indent: 0px; =
    text-transform: none; white-space: normal; widows: auto; word-spacing: =
    0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div =
    style=3D"color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; =
    text-align: start; text-indent: 0px; text-transform: none; white-space: =
    normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
    word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><div style=3D"color: rgb(0, 0, 0); font-family: =
    Arial; font-style: normal; font-variant: normal; font-weight: normal; =
    letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
    -webkit-auto; text-indent: 0px; text-transform: none; white-space: =
    normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
    word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><div style=3D"color: rgb(0, 0, 0); font-family: =
    Arial; font-style: normal; font-variant: normal; font-weight: normal; =
    letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
    -webkit-auto; text-indent: 0px; text-transform: none; white-space: =
    normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
    word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><div style=3D"color: rgb(0, 0, 0); font-family: =
    Arial; font-style: normal; font-variant: normal; font-weight: normal; =
    letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
    -webkit-auto; text-indent: 0px; text-transform: none; white-space: =
    normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
    word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><div style=3D"font-family: Arial; font-style: =
    normal; font-variant: normal; font-weight: normal; letter-spacing: =
    normal; line-height: normal; orphans: 2; text-align: -webkit-auto; =
    text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
    word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><div style=3D"font-family: Arial; font-style: =
    normal; font-variant: normal; font-weight: normal; letter-spacing: =
    normal; line-height: normal; orphans: 2; text-align: -webkit-auto; =
    text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
    word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><div style=3D"font-family: Arial; font-style: =
    normal; font-variant: normal; font-weight: normal; letter-spacing: =
    normal; line-height: normal; orphans: 2; text-align: -webkit-auto; =
    text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
    word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" style=3D"color: =
    rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: =
    normal; font-weight: normal; letter-spacing: normal; line-height: =
    normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; =
    text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; =
    -webkit-text-stroke-width: 0px; border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"font-size: 12px;"><font =
    class=3D"Apple-style-span" color=3D"#000A8D" size=3D"3"><span =
    class=3D"Apple-style-span" style=3D"font-size: 11px;"><br =
    class=3D"Apple-interchange-newline">Best regards</span></font></div><div =
    style=3D"font-size: 12px;"><font class="3D""Apple-style-span" =
    color=3D"#000A8D" size=3D"4"><br =
    class=3D"khtml-block-placeholder"></font></div><div style=3D"font-size: =
    12px;"><font class="3D""Apple-style-span" color=3D"#000A8D" =
    size=3D"4">Sophie Jewry</font></div><div><font =
    class=3D"Apple-style-span"><br class="3D""Apple-interchange-newline"><span =
    class=3D"Apple-style-span" style=3D"font-size: 12px;"><font =
    class=3D"Apple-style-span" color=3D"#1265AD" size=3D"5" =
    style=3D"font-size: 25px;">media</font><font class="3D""Apple-style-span" =
    color=3D"#000A8D" size=3D"5" style=3D"font-size: =
    25px;">8</font></span><br><div><font class="3D""Apple-style-span"><font =
    class=3D"Apple-style-span"><div style=3D"font-size: 12px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div><font =
    color=3D"#0e7abb">Tel: 01362 853 424</font></div><div><font =
    color=3D"#0e7abb">Email: <a =
    href=3D"mailto:[email protected]">[email protected]</a></font></=
    div><div><font color=3D"#0e7abb">Gunfield House, 20 Allwood Avenue, =
    Scarning, Dereham, Norfolk NR19 2TF</font></div><div><font =
    color=3D"#0e7abb">www.<span style=3D"text-align: -webkit-auto;"><a =
    href=3D"http://sophiejewry.com">sophiejewry.com</a></span></font></div><di=
    v><br></div><div><font color=3D"#d83893"><b><i>*Winner of the Future 50 =
    Young Social Entrepreneur of the Year Award =
    2013*</i></b></font></div><div><font class="3D""Apple-style-span" =
    color=3D"#555555"><br></font></div></span></div></span></div></span></div>=
    </span></div></span></div></span></span></div></span></div></span></div></=
    span></div></span></div></span></div></span></div></span></div></span></di=
    v></span></div></span></div></span></div></span></div></span></span></span=
    ></span></div></span></div></span><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><font =
    class=3D"Apple-style-span" color=3D"#555555"><div><font =
    style=3D"text-align: -webkit-auto;"><b><a =
    href=3D"http://www.linkedin.com/in/sophiejewry">www.linkedin.com/in/sophie=
    jewry</a></b></font> - Connect on LinkedIn</div><div><span =
    style=3D"text-align: -webkit-auto;"><b><a =
    href=3D"https://plus.google.com/+SophieJewry">https://plus.google.com/+Sop=
    hieJewry</a></b></span> - Connect on Google+</div><div><b><a =
    href=3D"http://www.twitter.com/SophieJewry">www.twitter.com/SophieJewry</a=
    ></b> - Follow me on Twitter</div><div><font style=3D"text-align: =
    -webkit-auto;"><b><a =
    href=3D"http://www.facebook.com/TheBrandKitchen">www.facebook.com/TheBrand=
    Kitchen</a></b></font><font class="3D""Apple-style-span" =
    style=3D"text-align: -webkit-auto;"> - Branding and business =
    tips</font></div><div>Other things to =
    explore...</div></font></span></span></span></span></span></div></span></d=
    iv></span></div></span></div></span></div></span></div></span></div></span=
    ></span></div></span></div></span></div></span></div></span></div></span><=
    /div></span></div></span></div></span></div></span></div></span></div></sp=
    an></span></span></div></span></span></span></span></span></span></div></s=
    pan></div></span></div></span></div></span></div></span></div></span></div=
    ></span></div></span></div></span></div><font color=3D"#555555"><b><a =
    href=3D"http://www.organic-skincare.co.uk">www.organic-skincare.co.uk</a><=
    /b> - Fantastic quality organic products for body, skin and healthy =
    living inside and out</font></div><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"><b><a =
    href=3D"http://www.theholisticdirectory.co.uk">www.theholisticdirectory.co=
    .uk</a></b> - Connecting, supporting and promoting holistic =
    professionals</font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: =
    0px;"></span></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"></span></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: =
    0px;"></span></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"></font><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font =
    color=3D"#555555"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div><b><a =
    href=3D"http://www.mynorfolkguide.co.u">www.mynorfolkguide.co.u</a></b><b>=
    k</b> - Online Norfolk directory, list your business for =
    FREE</div><div><b><a =
    href=3D"http://www.ladiesnetwork.co.uk">www.ladiesnetwork.co.uk</a></b>&nb=
    sp;- Womens' networking =
    group</div></span></span></span></span></span></font></div></div></div></d=
    iv></div></div></div></div></div></div></div></div></div></div></div></div=
    ></div></div></div></div></div></div></div></div></div></div></div></div><=
    /div><span class="3D""Apple-style-span" style=3D"border-collapse: =
    separate; border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: =
    0px;"><br></span></div></span></div></span></div></span></div></span></div=
    ></span></span></div></span></div></span></div></span></div></span></div><=
    /span></div></span></div></span></div></span></div></span></div></span></d=
    iv></span></div></span></div></span></span></span></span><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><b><i><span =
    class=3D"Apple-style-span" style=3D"font-size: 11px;">Important note =
    about proofs, print and payment:</span> </i></b></span><span =
    style=3D"text-align: -webkit-auto; font-style: italic; font-size: =
    11px;">Artwork is charged at =A340 per hour, unless otherwise confirmed =
    in writing.</span><span style=3D"text-align: -webkit-auto; font-style: =
    italic; font-size: 11px;"> </span><font style=3D"text-align: =
    -webkit-auto; font-style: italic; font-size: 11px;">If proofing artwork =
    please check carefully all spellings and content as amendments cannot be =
    made once files have been supplied to the printers. </font><span =
    class=3D"Apple-style-span" style=3D"font-style: italic; font-size: =
    11px;">It is the responsibility of the customer to check proofs for =
    accuracy including contact details. </span><span =
    class=3D"Apple-style-span" style=3D"text-align: -webkit-auto; =
    font-style: italic; font-size: 11px;">All invoices should be paid by =
    return or in any case within 7 days of receipt. </span><span =
    class=3D"Apple-style-span" style=3D"text-align: -webkit-auto; =
    font-style: italic; font-size: 11px;">No material/adverts designed by =
    media8 can reproduced in any other publication without the written =
    permission of the owners or its agents. </span><span =
    class=3D"Apple-style-span" style=3D"text-align: -webkit-auto; =
    font-style: italic; font-size: 11px;">The colour may differ slightly in =
    print due to a difference in screen colour and resolution (Finished =
    print is always inCMYK). </span><span style=3D"text-align: =
    -webkit-auto; font-style: italic; font-size: 11px;">Our Couriers will =
    not(and hence we cannot) take responsibility for items which have been =
    accepted as being in good condition on delivery. Hence please check your =
    delivery carefully BEFORE signing your delivery note. Our courier will =
    NOT ACCEPT responsibility for damaged print if the delivery note has =
    been signed without comment. It is much better to check your goods =
    before signing but if you are unable to check on delivery please write =
    GOODS DAMAGED on the delivery note before signing everytime.</span><span =
    style=3D"text-align: -webkit-auto; font-style: italic; font-size: =
    11px;"> </span><i><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space; display: inline !important;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"display: =
    inline !important;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
    display: inline =
    !important;"><br></div></div></span></div></span></span></div><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    text-align: -webkit-auto; border-spacing: 0px;"><div style=3D"word-wrap: =
    break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
    after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; text-align: -webkit-auto; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><div style=3D"word-wrap: break-word; =
    -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span =
    class=3D"Apple-style-span" style=3D"border-collapse: separate; =
    border-spacing: 0px;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: 0px;"><div =
    style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
    -webkit-line-break: after-white-space;"><span class="3D""Apple-style-span" =
    style=3D"border-collapse: separate; border-spacing: =
    0px;"><div><div><div><div><div><div><div><div><div><div><div><div><div><di=
    v><div><div><div style=3D"font-size: 22px;"><span =
    class=3D"Apple-style-span" style=3D"font-size: 12px;"><font =
    class=3D"Apple-style-span" size=3D"3"><span class="3D""Apple-style-span" =
    style=3D"font-size: 11px;">This e-mail (including any attachments) is =
    confidential. If you are not the intended recipient you are prohibited =
    from acting upon, </span></font><font class="3D""Apple-style-span" =
    size=3D"3"><span class="3D""Apple-style-span" style=3D"font-size: =
    11px;">printing, copying or distributing it. If you have received this =
    e-mail in error, please notify the sender immediately by telephone =
    or </span></font><font class="3D""Apple-style-span" size=3D"3"><span =
    class=3D"Apple-style-span" style=3D"font-size: 11px;">by e-mail and =
    delete this e-mail from your system. It is possible for data conveyed by =
    e-mail to be deliberately or accidentally </span></font><font =
    class=3D"Apple-style-span" size=3D"3"><span class="3D""Apple-style-span" =
    style=3D"font-size: 11px;">intercepted or corrupted. We are unable to =
    accept any responsibility for any breaches of confidentiality which may =
    arise through the use </span></font><font class="3D""Apple-style-span" =
    size=3D"3"><span class="3D""Apple-style-span" style=3D"font-size: =
    11px;">of this medium. Whilst we make every effort to ensure that this =
    e-mail is free from viruses, this cannot be guaranteed. We =
    recommend that you scan all e-mails for viruses with appropriate =
    and frequently updated virus checking =
    software.</span></font></span></div></div></div></div></div></div></div></=
    div></div></div></div></div></div></div></div></div></div></span></div></s=
    pan></div></span></div></span></div></span></div></span></span></div></spa=
    n></div></span></div></span></div></span></div></span></div></span></div><=
    /span></div></span></div></span></div></span></div></span></div></span></d=
    iv></span></span></span></div></span></div></span></div></span></div></spa=
    n></div></span></span></div></span></div></span></div></span></div></span>=
    </div></span></div></span></div></span></div></span></div></span></div></s=
    pan></div></span></div></span></div></span></span></span></i></div></span>=
    </div></span></div></div></font></font></div></font></div></span></div></s=
    pan></div></span></div></span></div></span></div></span></span></div></spa=
    n></div></span></div></span></div></span></div></span></div></span></div><=
    /span></div></span></div></span></div></span></div></span></div></span></d=
    iv></span></span></span></span></div></span></div></span></div></div></div=
    ></div></div></div></div></div></div></div>
    </div>

    Make your signature text only, see if that makes a difference.

  • Very slow query when specifying where clause

    Hi folks:
    I am using SAS with SQL Passthrough for Oracle, however that may be irrelevant to the problem.
    I have a query that I am subsetting based on a series of where clauses, and when I put the clauses into the query, it slows it down tremendously.
    I can pull the entire table and subset it later on in SAS and it is much faster.
    Can someone explain why the SQL subsetting logic runs slower than pulling 18M rows and subsetting later?
    Here is my query - hope this is enough information
    select
    a.loan_number
    , a.CFLRC_CD
    , a.cservno
    , b.cprj_typ
    , a.occ_stat
    , c.state2
    , c.city2
    , e.hstatus
    , e.hcattype
    , e.dqind
    , e.mthsdel
    from
    VEW_LL_ln_1 a
    , vew_ll_ln_2 b
    , VEW_LL_PROP_GEO_CD c
    , vew_ll_ln_actvy_1 e
    where
    a.loan_number = b.loan_number
    and a.loan_number = c.loan_number
    and a.loan_number = e.loan_number
    and e.act_dte = '01-feb-2011'
    and not (occ_stat in ('2','3'))
    and hcattype <> '800'
    and dqind not in ('E','F','G','H')
    and cprj_typ not in ('1','2','3','4','5','16','17','18','19','20','21','22')
    and cflrc_cd <> '2'
    order by
    a.loan_number
    Thanks

    You're in the wrong forum. This is the forum for the SQL Developer tool. You will get better answers in the SQL and PL/SQL forum which is here PL/SQL

  • Slow query due to large table and full table scan

    Hi,
    We have a large Oracle database, v 10g. Two of the tables in the database have over one million rows.
    We have a few queries which take a lot of time to execute. Not always though, it that seems when load is high the queries tend
    to take much longer. Average time may be 1 or 2 seconds, but maxtime can be up to 2 minutes.
    We have now used Oracle Grid to help us examine the queries. We have found that some of the queries require two or three full table scans.
    Two of the full table scans are of the two large tables mentioned above.
    This is an example query:
    SELECT table1.column, table2.column, table3.column
    FROM table1
    JOIN table2 on table1.table2Id = table2.id
    LEFT JOIN table3 on table2.table3id = table3.id
    WHERE table1.id IN(
    SELECT id
    FROM (
    (SELECT a.*, rownum rnum FROM(
    SELECT table1.id
    FROM table1,
    table2,
    table3
    WHERE
    table1.table2id = table2.id
    AND
    table2.table3id IS NULL OR table2.table3id = :table3IdParameter
    ) a
    WHERE rownum <= :end))
    WHERE rnum >= :start
    Table1 and table2 are the large tables in this example. This query starts two full table scans on those tables.
    Can we avoid this? We have, what we think are, the correct indexes.
    /best regards, Håkan

    >
    Hi Håkan - welcome to the forum.
    We have a large Oracle database, v 10g. Two of the tables in the database have over one million rows.
    We have a few queries which take a lot of time to execute. Not always though, it that seems when load is high the queries tend
    to take much longer. Average time may be 1 or 2 seconds, but maxtime can be up to 2 minutes.
    We have now used Oracle Grid to help us examine the queries. We have found that some of the queries require two or three full table scans.
    Two of the full table scans are of the two large tables mentioned above.
    This is an example query:Firstly, please read the forum FAQ - top right of page.
    Please format your SQL using tags [code /code].
    In order to help us to help you.
    Please post table structures - relevant (i.e. joined, FK, PK fields only) in the form - note use of code tags - we can just run table create script.
    CREATE TABLE table1
      Field1  Type1,
      Field2  Type2,
    FieldN  TypeN
    );Then give us some table data - not 100's of records - just enough in the form
    INSERT INTO Table1 VALUES(Field1, Field2.... FieldN);
    ..Please post EXPLAIN PLAN - again with tags.
    HTH,
    Paul...
    /best regards, Håkan

  • How to speed up a very slow query creating HTML commands

    Hi, I’m generating HTML code that I will later send via dbmail (@body_format ='HTML'). There are about 11K records in the table and it takes over 9 hours to run. Any suggestions on how to increase throughput? or am I just stuck with it
    declare @html_3 varchar (max) = ' '
    select @@html_3 = @html_3 + '<tr> <td>' + cast (RegionID as varchar) + '</td><td>'
                    + RegionName + '</td><td>'
                     + cast (FileID as varchar) + '</td><td>'
                     + cast (FileNum as varchar) + '</td><td>'
                  + FileStatus + '</td><td>'
         + DeliveryStatus + '</td><td>'
         +TaskName + '</td><td>'
          + cast (EventStartDate as varchar) + '</td><td>'
      + cast (DeliveryEventLogID as varchar) + '</td><td>'
     + DeliveryServer + '</td><td>'
     + IISServer + '</td><td>'
     + UserName + '</td><td>'
     + DeliverEvent + '</td><td>'
     + NotificationEvent + '</td><td>'
     + DeliveryComments + '</td><td>'
                   + PronoComments + '</td></tr>'
    from ##PronoDetailRpt
    print @html_3

    If you have only 11K records, and if what you posted is the entire query, it should take nowhere near 9 hours to complete, even on a wimpy server. It might be that some other process is blocking your global temporary table.  
    Look at the process that is populating the
    ##PronoDetailRpttable. Is that running simultaneously as you are trying to run this query?
    Try selecting a single record from the table. Does that complete in a short time? i.e., run SELECT TOP (1) * FROM ##PronoDetailRpt;
    Run sp_who2 in a separate window while this query is running to see if there is anything blocking this
    query. There is a BlkBy column that will give you this information.
    EDIT: By the way, always specify a length for VARCHAR.  So instead of CAST (RegionID AS VARCHAR) use something like CAST (RegionID AS VARCHAR(32)) where the length is larger than the longest string you expect, or if you don't know how long it
    could be, use CAST (RegionID AS VARCHAR(MAX))

  • Very slow query

    Hi,
    we execute the following :
    select count(*) from mytable.
    We wait more than 20 minutes and then stop. I generated a AWR report for the time it was running :
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Buffer Nowait %:  100.00 ;      Redo NoWait %:  100.00
                Buffer  Hit   %:   84.12 ;   In-memory Sort %:  100.00
                Library Hit   %:   99.47 ;       Soft Parse %:   99.69
             Execute to Parse %:   49.43 ;        Latch Hit %:  100.00
    Parse CPU to Parse Elapsd %:   50.07 ;    % Non-Parse CPU:   97.28
    Shared Pool Statistics        Begin    End
                 Memory Usage %:   78.11 ;  81.58
        % SQL with executions>1:   96.81 ;  95.22
      % Memory for SQL w/exec>1:   90.92 ;  89.73
    Top 5 Timed Events                                         Avg %Total
    ~~~~~~~~~~~~~~~~~~                                        wait   Call
    Event                                 Waits    Time (s)   (ms)   Time Wait Class
    local write wait                  1,104,035         790      1   50.9 ;  User I/O
    db file parallel write              990,897         764      1   49.3 System I/O
    control file parallel write         218,131         228      1   14.7 System I/O
    CPU time                                            134           8.6
    db file sequential read             639,781         107      0    6.9 ;  User I/O
              ------------------------------------------------------------- Can we say that the main problem is writing on disk since we have local write wait and db file parallel write ?
    If not after this AWR report what might be the problem ?
    Thank you.

    Hi;
    What is db version? Please see this
    Regard
    Helios

  • Very Slow Connection due to Low IP Profile

    Our connection is supposed to be 2 Mb/s, although recently it has dropped to a fraction of that because the IP profile has been changed to 0.25 Mb/s.
    I plugged the router into the test socket yesterday, and the quiet line test did not have a noisy signal. I will leave the router on for at least three days to see if the profile is reset to the correct value.
    ADSL Line Status
    Connection information
    Line state:
    Connected
    Connection time:
    0 day, 21:32:22
    Downstream:
    288 Kbps
    Upstream:
    448 Kbps
      ADSL settings
    VPI/VCI:
    0/38
    Type:
    PPPoA
    Modulation:
    G.992.1 Annex A
    Latency type:
    Interleaved
    Noise margin (Down/Up):
    37.3 dB / 19.0 dB
    Line attenuation (Down/Up):
    55.0 dB / 31.5 dB
    Output power (Down/Up):
    13.5 dBm / 11.9 dBm
    FEC Events (Down/Up):
    6 / 67
    CRC Events (Down/Up):
    0 / 13
    Loss of Framing (Local/Remote):
    0 / 0
    Loss of Signal (Local/Remote):
    0 / 0
    Loss of Power (Local/Remote):
    0 / 0
    Loss of Link (Remote):
    0
    HEC Errors (Down/Up):
    0 / 11
    Error Seconds (Local/Remote):
    0 / 0
    1. Best Effort Test: -provides background information.
    Download  Speed
    0.25 Mbps
    0 Mbps
    0.25 Mbps
    Max Achievable Speed
     Download speedachieved during the test was - 0.25 Mbps
     For your connection, the acceptable range of speeds is 0.05 Mbps-0.25 Mbps.
     Additional Information:
     Your DSL Connection Rate :0.29 Mbps(DOWN-STREAM), 0.45 Mbps(UP-STREAM)
     IP Profile for your line is - 0.25 Mbps
    Solved!
    Go to Solution.

    Thank you. I checked the connection status again, and the noise margin has decreased significantly. However, it must have disconnected itself at some point since it only says it's been connected for less than 3 hours.
    ADSL Line Status
    Connection information
    Line state:
    Connected
    Connection time:
    0 day, 02:45:10
    Downstream:
    160 Kbps
    Upstream:
    448 Kbps
      ADSL settings
    VPI/VCI:
    0/38
    Type:
    PPPoA
    Modulation:
    G.992.1 Annex A
    Latency type:
    Interleaved
    Noise margin (Down/Up):
    7.7 dB / 11.0 dB
    Line attenuation (Down/Up):
    61.0 dB / 31.5 dB
    Output power (Down/Up):
    11.6 dBm / 11.9 dBm
    FEC Events (Down/Up):
    138 / 40
    CRC Events (Down/Up):
    17 / 13
    Loss of Framing (Local/Remote):
    0 / 0
    Loss of Signal (Local/Remote):
    0 / 0
    Loss of Power (Local/Remote):
    0 / 0
    Loss of Link (Remote):
    0
    HEC Errors (Down/Up):
    18 / 9
    Error Seconds (Local/Remote):
    0 / 0

  • [11g R2] Update-Select with BITMAP CONVERSION TO ROWIDS = very slow

    Hi all,
    I have to deal with some performance issues in our database.
    The query below takes between 30 minutes and 60 minutes to complete (30 minutes during the batch process and 1h when I executed the query with SQLPLUS):
    SQL_ID  4ky65wauhg1ub, child number 0
    UPDATE fiscpt x    SET (x.cimld) =           (SELECT COUNT (*)         
        FROM fiscpt f             WHERE f.comar = x.comar               AND
    f.coint = x.coint               AND f.nucpt = x.nucpt               AND
    f.codev != x.codev               AND f.cimvt != 0)  WHERE x.comar IN
    ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC')
    Plan hash value: 697684605
    | Id  | Operation                          | Name    | Starts | E-Rows |E-Bytes| Cost (%CPU)| E-Time   | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    |   0 | UPDATE STATEMENT                   |         |      1 |        |       |   773K(100)|          |      0 |00:22:22.30 |      36M|   7629 |       |       |          |
    |   1 |  UPDATE                            | FISCPT  |      1 |        |       |            |          |      0 |00:22:22.30 |      36M|   7629 |       |       |          |
    |   2 |   INLIST ITERATOR                  |         |      1 |        |       |            |          |    179K|00:00:00.37 |    1221 |      3 |       |       |          |
    |*  3 |    INDEX RANGE SCAN                | FISCPT1 |      7 |    154K|  4984K|     5   (0)| 00:00:01 |    179K|00:00:00.23 |    1221 |      3 |       |       |          |
    |   4 |   SORT AGGREGATE                   |         |    179K|      1 |    33 |            |          |    179K|01:02:58.45 |      35M|   3020 |       |       |          |
    |*  5 |    TABLE ACCESS BY INDEX ROWID     | FISCPT  |    179K|      1 |    33 |     4  (25)| 00:00:01 |  63681 |01:02:57.80 |      35M|   3020 |       |       |          |
    |   6 |     BITMAP CONVERSION TO ROWIDS    |         |    179K|        |       |            |          |    121K|01:02:52.71 |      35M|    885 |       |       |          |
    |   7 |      BITMAP AND                    |         |    179K|        |       |            |          |  87091 |01:02:52.25 |      35M|    885 |       |       |          |
    |   8 |       BITMAP CONVERSION FROM ROWIDS|         |    179K|        |       |            |          |    179K|00:00:03.31 |     241K|      0 |       |       |          |
    |*  9 |        INDEX RANGE SCAN            | FISCPT2 |    179K|   1547 |       |     1   (0)| 00:00:01 |   1645K|00:00:02.23 |     241K|      0 |       |       |          |
    |  10 |       BITMAP CONVERSION FROM ROWIDS|         |    179K|        |       |            |          |    148K|01:02:44.98 |      35M|    885 |       |       |          |
    |  11 |        SORT ORDER BY               |         |    179K|        |       |            |          |   2412M|00:52:19.70 |      35M|    885 |  1328K|   587K| 1180K (0)|
    |* 12 |         INDEX RANGE SCAN           | FISCPT1 |    179K|   1547 |       |     2   (0)| 00:00:01 |   2412M|00:22:11.22 |      35M|    885 |       |       |          |
    Query Block Name / Object Alias (identified by operation id):
       1 - UPD$1
       3 - UPD$1 / X@UPD$1
       4 - SEL$1
       5 - SEL$1 / F@SEL$1
    Predicate Information (identified by operation id):
       3 - access(("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR "X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR
                  "X"."COMAR"='OCC'))
       5 - filter("F"."CIMVT"<>0)
       9 - access("F"."COINT"=:B1 AND "F"."NUCPT"=:B2)
      12 - access("F"."COMAR"=:B1)
           filter(("F"."CODEV"<>:B1 AND "F"."COMAR"=:B2))
    Column Projection Information (identified by operation id):
       2 - (upd=6; cmp=2,3,4,5) "SYS_ALIAS_4".ROWID[ROWID,10], "X"."COMAR"[VARCHAR2,5], "X"."COINT"[VARCHAR2,11], "X"."NUCPT"[VARCHAR2,8], "X"."CODEV"[VARCHAR2,3],
           "X"."CIMLD"[NUMBER,22]
       3 - "SYS_ALIAS_4".ROWID[ROWID,10], "X"."COMAR"[VARCHAR2,5], "X"."COINT"[VARCHAR2,11], "X"."NUCPT"[VARCHAR2,8], "X"."CODEV"[VARCHAR2,3], "X"."CIMLD"[NUMBER,22]
       4 - (#keys=0) COUNT(*)[22]
       5 - "F".ROWID[ROWID,10], "F"."COMAR"[VARCHAR2,5], "F"."COINT"[VARCHAR2,11], "F"."NUCPT"[VARCHAR2,8], "F"."CODEV"[VARCHAR2,3], "F"."CIMVT"[NUMBER,22]
       6 - "F".ROWID[ROWID,10]
       7 - STRDEF[BM VAR, 10], STRDEF[BM VAR, 10], STRDEF[BM VAR, 32496]
       8 - STRDEF[BM VAR, 10], STRDEF[BM VAR, 10], STRDEF[BM VAR, 32496]
       9 - "F".ROWID[ROWID,10]
      10 - STRDEF[BM VAR, 10], STRDEF[BM VAR, 10], STRDEF[BM VAR, 32496]
      11 - (#keys=1) "F".ROWID[ROWID,10]
      12 - "F".ROWID[ROWID,10]
    Note
       - dynamic sampling used for this statement (level=2)We intentionally don't gather statistics on the FISCPT table.
    There are no indexes on the column updated so the slowness is not due to updating of indexes:
    SQL> select index_name, column_name from user_ind_columns where table_name='FISCPT';
    INDEX_NAME COLUMN_NAM
    FISCPT1    NUCPT
    FISCPT1    CODEV
    FISCPT1    RGCID
    FISCPT1    DATRA
    FISCPT2    COINT
    FISCPT2    NUCPT
    FISCPT3    NUFIS
    FISCPT1    COINT
    FISCPT1    COMAR
    9 ligne(s) sÚlectionnÚe(s).
    SQL> select count(1) from FISCPT;
      COUNT(1)
        179369If I replace the UPDATE-SELECT statement by a SELECT, the query runs in few seconds:
    SQL>  SELECT COUNT (*)
      2               FROM fiscpt f, fiscpt x
      3              WHERE f.comar = x.comar
      4                AND f.coint = x.coint
      5                AND f.nucpt = x.nucpt
      6                AND f.codev != x.codev
      7                AND f.cimvt != 0
      8   and x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC');
      COUNT(*)
         63681
    EcoulÚ : 00 :00 :00.75
    SQL> select * from table(dbms_xplan.display_cursor());
    PLAN_TABLE_OUTPUT
    SQL_ID  5drbpdmdv0gv1, child number 0
    SELECT COUNT (*)              FROM fiscpt f, fiscpt x
    WHERE f.comar = x.comar               AND f.coint = x.coint
      AND f.nucpt = x.nucpt               AND f.codev != x.codev
       AND f.cimvt != 0  and x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX',
    'LIFFE', 'METAL', 'OCC')
    Plan hash value: 1326101771
    | Id  | Operation                      | Name    | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |         |       |       |       |  2477 (100)|          |
    |   1 |  SORT AGGREGATE                |         |     1 |    53 |       |            |          |
    |*  2 |   HASH JOIN                    |         |   107K|  5557K|  4720K|  2477   (1)| 00:00:30 |
    |   3 |    INLIST ITERATOR             |         |       |       |       |            |          |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| FISCPT  |   107K|  3460K|       |  1674   (1)| 00:00:21 |
    |*  5 |      INDEX RANGE SCAN          | FISCPT1 |   154K|       |       |   873   (0)| 00:00:11 |
    |*  6 |    INDEX FAST FULL SCAN        | FISCPT1 |   154K|  3021K|       |   337   (0)| 00:00:05 |
    Predicate Information (identified by operation id):
       2 - access("F"."COMAR"="X"."COMAR" AND "F"."COINT"="X"."COINT" AND
                  "F"."NUCPT"="X"."NUCPT")
           filter("F"."CODEV"<>"X"."CODEV")
       4 - filter("F"."CIMVT"<>0)
       5 - access(("F"."COMAR"='CBOT' OR "F"."COMAR"='CME' OR "F"."COMAR"='EUREX' OR
                  "F"."COMAR"='FOREX' OR "F"."COMAR"='LIFFE' OR "F"."COMAR"='METAL' OR "F"."COMAR"='OCC'))
       6 - filter(("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR
                  "X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR "X"."COMAR"='OCC'))
    Note
       - dynamic sampling used for this statement (level=2)The optimizer parameters are at their default values.
    The database is an 11.2.0.1 and the OS is a Linux Red hat.
    can someone help me to tune this query please?

    Thanks Tubby for your reply,
    We don't gather statistics at all on this table because it's a process table: on the production database we may have several processes which insert/delet/update rows into this table so we prefer to rely on Dynamic Sampling instead of gathering statistics each time a process need to access this table.
    I don't dynamic sampling is the problem here because when i use the level 10 the execution plan is the same:
    SQL> alter session set optimizer_dynamic_sampling=10;
    Session modifiÚe.
    EcoulÚ : 00 :00 :00.00
    SQL> explain plan for
      2  UPDATE fiscpt x
      3     SET (x.cimld) =
      4            (SELECT COUNT (*)
      5               FROM fiscpt f
      6              WHERE f.comar = x.comar
      7                AND f.coint = x.coint
      8                AND f.nucpt = x.nucpt
      9                AND f.codev != x.codev
    10                AND f.cimvt != 0)
    11   WHERE x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC');
    ExplicitÚ.
    EcoulÚ : 00 :00 :01.04
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 697684605
    | Id  | Operation                          | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT                   |         |   179K|  5780K|   896K (20)| 02:59:23 |
    |   1 |  UPDATE                            | FISCPT  |       |       |            |          |
    |   2 |   INLIST ITERATOR                  |         |       |       |            |          |
    |*  3 |    INDEX RANGE SCAN                | FISCPT1 |   179K|  5780K|     5   (0)| 00:00:01 |
    |   4 |   SORT AGGREGATE                   |         |     1 |    33 |            |          |
    |*  5 |    TABLE ACCESS BY INDEX ROWID     | FISCPT  |     1 |    33 |     4  (25)| 00:00:01 |
    |   6 |     BITMAP CONVERSION TO ROWIDS    |         |       |       |            |          |
    |   7 |      BITMAP AND                    |         |       |       |            |          |
    |   8 |       BITMAP CONVERSION FROM ROWIDS|         |       |       |            |          |
    |*  9 |        INDEX RANGE SCAN            | FISCPT2 |  1794 |       |     1   (0)| 00:00:01 |
    |  10 |       BITMAP CONVERSION FROM ROWIDS|         |       |       |            |          |
    |  11 |        SORT ORDER BY               |         |       |       |            |          |
    |* 12 |         INDEX RANGE SCAN           | FISCPT1 |  1794 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - access("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR
                  "X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR
                  "X"."COMAR"='OCC')
       5 - filter("F"."CIMVT"<>0)
       9 - access("F"."COINT"=:B1 AND "F"."NUCPT"=:B2)
      12 - access("F"."COMAR"=:B1)
           filter("F"."CODEV"<>:B1 AND "F"."COMAR"=:B2)
    Note
       - dynamic sampling used for this statement (level=10)I have tested the query you provided and the execution plan is almost the same (A FILTER clause is added but the COST isthe same):
    SQL> explain plan for
      2  UPDATE   fiscpt x
      3     SET (x.cimld) =
      4            (SELECT  COUNT (*)
      5               FROM fiscpt f
      6              WHERE f.comar = x.comar
      7                AND f.coint = x.coint
      8                AND f.nucpt = x.nucpt
      9                AND f.codev != x.codev
    10                AND f.cimvt != 0
    11                and   f.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC')
    12                )
    13   WHERE x.comar IN ('CBOT', 'CME', 'EUREX', 'FOREX', 'LIFFE', 'METAL', 'OCC');
    ExplicitÚ.
    EcoulÚ : 00 :00 :00.01
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1565986742
    | Id  | Operation                           | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT                    |         |   154K|  4984K|   773K (20)| 02:34:41 |
    |   1 |  UPDATE                             | FISCPT  |       |       |            |          |
    |   2 |   INLIST ITERATOR                   |         |       |       |            |          |
    |*  3 |    INDEX RANGE SCAN                 | FISCPT1 |   154K|  4984K|     5   (0)| 00:00:01 |
    |   4 |   SORT AGGREGATE                    |         |     1 |    33 |            |          |
    |*  5 |    FILTER                           |         |       |       |            |          |
    |*  6 |     TABLE ACCESS BY INDEX ROWID     | FISCPT  |     1 |    33 |     4  (25)| 00:00:01 |
    |   7 |      BITMAP CONVERSION TO ROWIDS    |         |       |       |            |          |
    |   8 |       BITMAP AND                    |         |       |       |            |          |
    |   9 |        BITMAP CONVERSION FROM ROWIDS|         |       |       |            |          |
    |* 10 |         INDEX RANGE SCAN            | FISCPT2 |  1547 |       |     1   (0)| 00:00:01 |
    |  11 |        BITMAP CONVERSION FROM ROWIDS|         |       |       |            |          |
    |  12 |         SORT ORDER BY               |         |       |       |            |          |
    |* 13 |          INDEX RANGE SCAN           | FISCPT1 |  1547 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - access("X"."COMAR"='CBOT' OR "X"."COMAR"='CME' OR "X"."COMAR"='EUREX' OR
                  "X"."COMAR"='FOREX' OR "X"."COMAR"='LIFFE' OR "X"."COMAR"='METAL' OR "X"."COMAR"='OCC')
       5 - filter(:B1='CBOT' OR :B2='CME' OR :B3='EUREX' OR :B4='FOREX' OR :B5='LIFFE' OR
                  :B6='METAL' OR :B7='OCC')
       6 - filter(("F"."COMAR"='CBOT' OR "F"."COMAR"='CME' OR "F"."COMAR"='EUREX' OR
                  "F"."COMAR"='FOREX' OR "F"."COMAR"='LIFFE' OR "F"."COMAR"='METAL' OR
                  "F"."COMAR"='OCC') AND "F"."CIMVT"<>0)
      10 - access("F"."COINT"=:B1 AND "F"."NUCPT"=:B2)
      13 - access("F"."COMAR"=:B1)
           filter("F"."CODEV"<>:B1 AND ("F"."COMAR"='CBOT' OR "F"."COMAR"='CME' OR
                  "F"."COMAR"='EUREX' OR "F"."COMAR"='FOREX' OR "F"."COMAR"='LIFFE' OR
                  "F"."COMAR"='METAL' OR "F"."COMAR"='OCC') AND "F"."COMAR"=:B2)
    Note
       - dynamic sampling used for this statement (level=2)I have executed this statement for 50 minutes and it is still running now
    Furthermore, I have used the tuning advisor but it has not found any recommendation.
    is it normal that oracle takes 1hour to update 175k rows?

  • Select query performance is very slow

    Could you please explain me about BITMAP CONVERSION FROM ROWIDS
    Why the below query going for two times BITMAP CONVERSION TO ROWIDS on the same table.
    SQL> SELECT AGG.AGGREGATE_SENTENCE_ID ,
      2         AGG.ENTITY_ID,
      3         CAR.REQUEST_ID REQUEST_ID
      4    FROM epic.eh_aggregate_sentence agg ,om_cpps_active_requests car
      5   WHERE car.aggregate_sentence_id =agg.aggregate_sentence_id
      6  AND car.service_unit = '0ITNMK0020NZD0BE'
      7  AND car.request_type = 'CMNTY WORK'
      8  AND agg.hours_remaining > 0         
      9  AND NOT EXISTS (SELECT 'X'
    10                    FROM epic.eh_agg_sent_termination aggSentTerm
    11                   WHERE aggSentTerm.aggregate_sentence_id = agg.aggregate_sentence_id
    12                     AND aggSentTerm.date_terminated <= epic.epicdatenow);
    Execution Plan
    Plan hash value: 1009556971
    | Id  | Operation                           | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                    |                            |     5 |   660 |    99   (2)| 00:00:02 |
    |*  1 |  HASH JOIN ANTI                     |                            |     5 |   660 |    99   (2)| 00:00:02 |
    |   2 |   NESTED LOOPS                      |                            |       |       |            |          |
    |   3 |    NESTED LOOPS                     |                            |     7 |   658 |    95   (0)| 00:00:02 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID     | OM_CPPS_ACTIVE_REQUESTS    |    45 |  2565 |    50   (0)| 00:00:01 |
    |   5 |      BITMAP CONVERSION TO ROWIDS    |                            |       |       |            |          |
    |   6 |       BITMAP AND                    |                            |       |       |            |          |
    |   7 |        BITMAP CONVERSION FROM ROWIDS|                            |       |       |            |          |
    |*  8 |         INDEX RANGE SCAN            | OM_CA_REQUEST_REQUEST_TYPE |   641 |       |    12   (0)| 00:00:01 |
    |   9 |        BITMAP CONVERSION FROM ROWIDS|                            |       |       |            |          |
    |* 10 |         INDEX RANGE SCAN            | OM_CA_REQUEST_SERVICE_UNIT |   641 |       |    20   (0)| 00:00:01 |
    |* 11 |     INDEX UNIQUE SCAN               | PK_EH_AGGREGATE_SENTENCE   |     1 |       |     0   (0)| 00:00:01 |
    |* 12 |    TABLE ACCESS BY INDEX ROWID      | EH_AGGREGATE_SENTENCE      |     1 |    37 |     1   (0)| 00:00:01 |
    |  13 |   TABLE ACCESS BY INDEX ROWID       | EH_AGG_SENT_TERMINATION    |    25 |   950 |     3   (0)| 00:00:01 |
    |* 14 |    INDEX RANGE SCAN                 | DATE_TERMINATED_0520       |     4 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access("AGGSENTTERM"."AGGREGATE_SENTENCE_ID"="AGG"."AGGREGATE_SENTENCE_ID")
       4 - filter("CAR"."AGGREGATE_SENTENCE_ID" IS NOT NULL)
       8 - access("CAR"."REQUEST_TYPE"='CMNTY WORK')
      10 - access("CAR"."SERVICE_UNIT"='0ITNMK0020NZD0BE')
      11 - access("CAR"."AGGREGATE_SENTENCE_ID"="AGG"."AGGREGATE_SENTENCE_ID")
      12 - filter("AGG"."HOURS_REMAINING">0)
      14 - access("AGGSENTTERM"."DATE_TERMINATED"<="EPIC"."EPICDATENOW"())now this query is giving the correct result, but performance is slow.
    Please help to improve the performance.
    SQL> desc epic.eh_aggregate_sentence
    Name                                      Null?    Type
    ENTITY_ID                                          CHAR(16)
    AGGREGATE_SENTENCE_ID                     NOT NULL CHAR(16)
    HOURS_REMAINING                                    NUMBER(9,2)
    SQL> desc om_cpps_active_requests
    Name                                      Null?    Type
    REQUEST_ID                                NOT NULL VARCHAR2(16)
    AGGREGATE_SENTENCE_ID                              VARCHAR2(16)
    REQUEST_TYPE                              NOT NULL VARCHAR2(20)
    SERVICE_UNIT                                       VARCHAR2(16)
    SQL> desc epic.eh_agg_sent_termination
    Name                                      Null?    Type
    TERMINATION_ID                            NOT NULL CHAR(16)
    AGGREGATE_SENTENCE_ID                     NOT NULL CHAR(16)
    DATE_TERMINATED                           NOT NULL CHAR(20)
    .

    user10594152 wrote:
    Thanks for your reply.
    Still i am getting same problemIt is not a problem. Bitmap conversion usually is a very good thing. Useing this feature the database can use one or several unselective b*indexes. Combine them and do a kind of bitmap selection. THis should be slightly faster than a FTS and much faster than a normal index access.
    Your problem is that your filter criteria seem to be not very usefull. Whcih is the criteria that does the best reduction of rows?
    Also any kind of NOT EXISTS is potentiall not very fast (NOT IN is worse). You can rewrite your query with an OUTER JOIN. Sometimes this will help, but not always.
    SELECT AGG.AGGREGATE_SENTENCE_ID ,
            AGG.ENTITY_ID,
            CAR.REQUEST_ID REQUEST_ID
    FROM epic.eh_aggregate_sentence agg
    JOIN om_cpps_active_requests car ON ar.aggregate_sentence_id =agg.aggregate_sentence_id
    LEFT JOIN epic.eh_agg_sent_termination aggSentTerm ON aggSentTerm.aggregate_sentence_id = agg.aggregate_sentence_id and aggSentTerm.date_terminated <= epic.epicdatenow
    WHERE car.service_unit = '0ITNMK0020NZD0BE'
    AND car.request_type = 'CMNTY WORK'
    AND agg.hours_remaining > 0         
    AND aggSentTerm.aggregate_sentence_id is nullEdited by: Sven W. on Aug 31, 2010 4:01 PM

  • Query result is very slow

    i have two table master detail, for instance dept and emp
    the situtation is this. i need the recod of those departements who has clerks in specific time hired. i wrote following query. but due to millions of records in two tables its very very slow.
    select * from emp a,dept b
    where a.deptno in (select distinct deptno from emp where job='clerk')
    and hiredate >= '01-jun-2004' and hiredate <='01-jan-2007'
    and a.deptno=b.deptno
    can any body tune it.

    One thing I am seeing, that I find very troubling, is that posters such as the OP on this thread seem to be facing these tasks in a classroom or testing environment where they don't actually have access to Oracle and SQL*Plus.
    They are being asked to tune something that exists only on paper and don't have the tools to provide an explain plan, probably don't even have the ability to do a describe on the table(s) because they don't actually exist.
    If this is the case then the education system is cheating these people because tuning is not done in a room with the lights off by guessing. It is done, and only done, with:
    EXPLAIN PLAN FOR
    DBMS_XPLAN
    TKPROF
    a look at the statistics, etc.
    Here's a real-world example of what is wrong with what I see. Anyone want to guess which of these queries is the most efficient?
    SELECT srvr_id
    FROM servers
    INTERSECT
    SELECT srvr_id
    FROM serv_inst;
    SELECT srvr_id
    FROM servers
    WHERE srvr_id IN (
      SELECT srvr_id
      FROM serv_inst);
    SELECT srvr_id
    FROM servers
    WHERE srvr_id IN (
      SELECT i.srvr_id
      FROM serv_inst i, servers s
      WHERE i.srvr_id = s.srvr_id);
    SELECT DISTINCT s.srvr_id
    FROM servers s, serv_inst i
    WHERE s.srvr_id = i.srvr_id;
    SELECT /*+ NO_USE_NL(s,i) */ DISTINCT s.srvr_id
    FROM servers s, serv_inst i
    WHERE s.srvr_id = i.srvr_id;
    SELECT DISTINCT srvr_id
    FROM servers
    WHERE srvr_id NOT IN (
      SELECT srvr_id
      FROM servers
      MINUS
      SELECT srvr_id
      FROM serv_inst);
    SELECT srvr_id
    FROM servers s
    WHERE EXISTS (
      SELECT srvr_id
      FROM serv_inst i
      WHERE s.srvr_id = i.srvr_id);
    WITH q AS (
      SELECT DISTINCT s.srvr_id
      FROM servers s, serv_inst i
      WHERE s.srvr_id = i.srvr_id)
    SELECT * FROM q;
    SELECT DISTINCT s.srvr_id
    FROM servers s, serv_inst i
    WHERE s.srvr_id(+) = i.srvr_id;
    SELECT srvr_id
    FROM (
      SELECT srvr_id, SUM(cnt) SUMCNT
      FROM (
        SELECT DISTINCT srvr_id, 1 AS CNT
        FROM servers
        UNION ALL
        SELECT DISTINCT srvr_id, 1
        FROM serv_inst)
      GROUP BY srvr_id)
    WHERE sumcnt = 2;
    SELECT DISTINCT s.srvr_id
    FROM servers s, serv_inst i
    WHERE s.srvr_id+0 = i.srvr_id+0;And yes they all return the exact same result set using the test data.
    The chance that anyone can guess the most efficient query looking at what I just presented is precisely zero.
    Because the query most efficient in 8.1.7.4 is not the most efficient query in 9.2.0.4 which is not the most efficient query in 10.2.0.2.

  • Oracle query / view performing very slow.

    Hello,
    I had created a view in my application for example
    CREATE OR REPLACE VIEW EmpTransfer
    ( EMPID,EMPNAME,EMPMANAGER,EMPDOB,EMPTRANSFER)
    AS
    SELECT EMPID,EMPNAME,EMPMANAGER,EMPDOB,EMPTRANSFER
    FROM EMP ;
    After couple of months if we changed a columnname in the table EMP and added a new column.
    We changed column name EMPTRANSFER to OldEMPTRANSFER and added a new column as NEWEMPTRANSFER.
    The indexes were recreated on OldEMPTRANSFER and new index is creatd on NEWEMPTRANSFER column.
    the view is again recreated.
    CREATE OR REPLACE VIEW EmpTransfer
    ( EMPID,EMPNAME,EMPMANAGER,EMPDOB,OldEMPTRANSFER,NEWEMPTRANSFER )
    AS
    SELECT EMPID,EMPNAME,EMPMANAGER,EMPDOB,OldEMPTRANSFER ,NEWEMPTRANSFER
    FROM EMP ;
    This view is working as expected but some times this view is working very slow.
    The performance of this view is randomly slow.
    Is it possible that column name change will cause slowness...?

    What's the explain plans for both before and after the column change? It could possibly be running slow the first time because of a hard parse due to the query change, which will remain until it's in the shared_pool.
    Edited by: DaleyB on 07-Oct-2009 04:53

Maybe you are looking for

  • How can I edit data in Microsoft access using ActiveX

    I've tried to modify Read Access DB with ActiveX to edit an entry in my database, but I get the following error Exception occured in DAO.Field, Update or CancelUpdate without AddNew or Edit..

  • "No Audio Device Installed" in Windows Vista.

    Back in september 2011 I mysteriously lost my audio. I have a red X over my speaker icon in my system tray. When I put the cursor over the speaker icon I get this message "No Audio Device Installed". I went to the HP Customer web page and found the a

  • Pages 5.1 (1769) Crashes Trying to Print

    Pages 5.1 (1769) crashes every time I try and print something.  I am able to export to PDF and then print that document, however.  It seems to occur with both pages documents on my Mac and on iCloud.  I am printing to a network printer, and I do not

  • How to have full screen from a 3/4ths screen? 3/4ths happened accidently. How to avoid?     .

    How to change from the three-quarters display that I have now, to full screen display ? 3/4ths display was accidently done recently. Has happened before & Apple  people told me the fix, but have forgotten. Something simple. How to avoid in future ? T

  • I need to confirm my 2nd email address

    I need to confirm a 2nd email address, however I cannot use the link click, and when I paste it I get the message  "webpage cannot be displayed" how do I confirm