Not including the filter in the Plan to explain - filter (NULL IS NOT NULL)

Hi all

Ask your help to understand the scenario below. (I'm not aware of the details of the request and the table. Just trying to help my friend)

SQL> conn
Enter user-name: [email protected]
Enter password:
Connected.
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production

--Checking the count in PO_LINES

SQL> select count(*) from po_lines;

  COUNT(*)
----------
         0


--PO_LINES is a synonym 

SQL> select object_type,owner from dba_objects where object_name = 'PO_LINES';

OBJECT_TYPE         OWNER
------------------- ------------------------------
SYNONYM             APPS

--The synonym is pointing to PO.PO_LINES_ALL

SQL> select * from user_synonyms where synonym_name = 'PO_LINES';

SYNONYM_NAME                   TABLE_OWNER                    TABLE_NAME                     DB_LINK
------------------------------ ------------------------------ ------------------------------ ----------
PO_LINES                       PO                             PO_LINES_ALL


--But when counting PO.PO_LINES_ALL I am getting different result

SQL> select count(*) c from po.po_lines_all;

         C
----------
      8828

--Explain plan of teh original query is 

SQL> explain plan for
  2  select 
  3  * from po_lines;

Explained.

SQL> select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
----------------------------------------------------------------------

------------------------------------------------------------------------
| Id  | Operation          | Name         | Rows  | Bytes | Cost (%CPU)|
------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |              |     1 |   252 |     0   (0)|
|*  1 |  FILTER            |              |       |       |            |
|   2 |   TABLE ACCESS FULL| PO_LINES_ALL |  8796 |  2164K|   106   (4)|
------------------------------------------------------------------------

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

   1 - filter(NULL IS NOT NULL)

--Now the object PO.PO_LINES_ALL is TABLE, not an mview.

SQL> select object_type,owner from dba_objects where object_name = 'PO_LINES_ALL';

OBJECT_TYPE         OWNER
------------------- ------------------------------
TABLE               PO
Ask your help in understanding what is happening here.

Thanks in advance,
Jac

Maybe the CAE?

Tags: Database

Similar Questions

  • Unable to understand the Plan to explain

    Hi gurus

    I'm trying to understand some basics of explain plan and get a hard time, I was reading the book tuning performance and incapable of understanding explain plan for the following query:

    Example query

    EXPLAIN PLAN FOR

    SELECT *.

    WCP

    WHERE THERE IS NOT (SELECT 0

    OF THE Department

    WHERE dept.dname = 'SALES' AND dept.deptno = emp.deptno)

    AND NOT EXISTS (SELECT 0

    Bonus OF

    WHERE bonus.ename = emp.ename);

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

    Select * from table (dbms_xplan.display);

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

    Output

    Hash value of plan: 734347697

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

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

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

    |   0 | SELECT STATEMENT |       |     5.   290.     7 (15) | 00:00:01 |

    |*  1 |  HASH ANTI JOIN |       |     5.   290.     7 (15) | 00:00:01 |

    |*  2 |   HASH ANTI JOIN |       |     5.   255.     5 (20) | 00:00:01 |

    |   3.    TABLE ACCESS FULL | EMP |    14.   532.     2 (0) | 00:00:01 |

    |*  4 |    TABLE ACCESS FULL | DEPT |     1.    13.     2 (0) | 00:00:01 |

    |   5.   TABLE ACCESS FULL | BONUS |     1.     7.     2 (0) | 00:00:01 |

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

    Information of predicates (identified by the operation identity card):

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

    1 - access("BONUS".") ENAME "=" EMP ". ("' ENAME ')

    2 - access("DEPT".") DEPTNO "=" EMP ". ("' DEPTNO ')

    4 - filter("DEPT".") DNAME "= 'SALES')

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

    Grateful if someone help out me. Thank you

    In addition, I really appreciate if someone proposes a simple tutorial to explain plan. Thanks again

    Concerning

    Shu

    Hi Shuumail,

    Here is the tutorial http://allthingsoracle.com/execution-plans-part-1-finding-plans/

  • Explain the interpretation of the Plan

    Hi friends!

    I ve an anomaly in time of response of two databases that are equal between the two when I run the same query.

    On the first DB, when I run the query it takes 20 seconds, but on the second DB, the same query at 02:40 minutes.

    This Don t of sense to me, because the first DB contains a lot of data as second DB...

    I ve got the plan to explain both, but I Don t know how to interpret.

    It's the first DB EP, which is the fastest to execute the query (20 "):

    ********************************************************************************************************************************************************************************************

    SELECT STATEMENT CHOOSECost: 4 K bytes: 934 K cardinality: 4 K

    ORDER of 17 SORTING BY cost: 4 K bytes: 934 K cardinality: 4 K

    FILTER 16

    13 LOOPS IMBRIQUEES SEMI cost: 4 K bytes: 934 K cardinality: 4 K

    TABLE 11 ACCESS BY INDEX ROWID IMO. IDDPAR cost: 4 K bytes: 892 K cardinality: 4 K

    BITMAP 10 ROWID CONVERSION

    9 BITMAP AND

    5 BITMAP OR

    2 BITMAP CONVERSION TO ROWID

    1 INDEX RANGE SCAN NON-UNIQUE IMO. IDDPARX10 Cost: 306

    CONVERSION OF BITMAP ROWID 4

    3 INDEX RANGE SCAN NON-UNIQUE IMO. IDDPARX10 Cost: 3

    CONVERSION OF BITMAP TO 8 ROWID

    7 SORT ORDER BY

    6 INDEX RANGE SCAN NON-UNIQUE IMO. IDDPARX3 Cost: 455

    12 INDEX UNIQUE SCAN UNIQUE IMO. PK_IDDPACX1 bytes: 670 K cardinality: 62 K

    TABLE 15 ACCESS BY INDEX ROWID IMO. IDDPARE cost: 1 bytes: cardinality 1: 16

    14 INDEX UNIQUE SCAN UNIQUE IMO. Cardinality of PK_IDDPAREX1: 1

    ********************************************************************************************************************************************************************************************

    And it's the second DB, for the same query of course EP (2'40 "):

    **********************************************************************************************************************************************************

    SELECT STATEMENT CHOOSECost: 6 K bytes: 886 K cardinality: 4 K

    7 FILTER

    4 LOOPS IMBRIQUEES SEMI cost: 6 K bytes: 886 K cardinality: 4 K

    TABLE 2 ACCESS BY INDEX ROWID IMO. IDDPAR cost: 6 K bytes: 850 K cardinality: 4 K

    1 INDEX RANGE SCAN NON-UNIQUE IMO. IDDPARX5 cost: 298 cardinality: 11 K

    UNIQUE 3 INDEX SCAN UNIQUE IMO. PK_IDDPACX1 bytes: 417KO cardinality: 43 K

    TABLE 6 ACCESS BY INDEX ROWID IMO. IDDPARE cost: 1 bytes: cardinality 1: 16

    5 INDEX UNIQUE SCAN UNIQUE IMO. Cardinality of PK_IDDPAREX1: 1

    **********************************************************************************************************************************************************

    As you can see, second EP is as simple, but its effectiveness is much poorer.

    I m intends to interpret my experience with Plans to explain, but it is virtually zero. The most obvious difference I found is the BITMAP CONVERSION OF LINES and CONVERSION of bitmap to LINES Kael'thas appear in the first EP.

    I searched ´ve documentation CONVERSION BITMAP and I ve include, more or less. But I Don t know what measures to take to optimizer are Oracle do the same conversion on the second EP.

    I Don t pretend that someone to teach me everything on explains Plans for interpretation, I m aware of the track of this.

    But would like advice on how I can solve this problem. Any suggestion will be welcome.

    Thanks in advance

    AlexTutor wrote:

    All databases are Enterprise Edition.

    And I ve already tried with advice like that of...

    Okay - so now that you have shown us the request, can you show us EXACTLY what the real "index_combine" referring to the fact that you used looked like and tell us if the execution plan has changed at all with this suspicion.

    Note: Oracle does not ignore the advice, so if your data structures are the same, and you have the right to hint, Oracle would HAVE to give you the plan you want. The only reason why he could not is if the presence of the indication caused Oracle to examine an alternative implementation plan which was (a) cheaper than suggested and (b) a plan which the index was illegal.

    Concerning

    Jonathan Lewis

  • Explain the Plan in pl/sql

    Dear all.
     
    /*
    DBMS_XPLAN.DISPLAY_CURSOR(
       sql_id        IN  VARCHAR2  DEFAULT  NULL,
       child_number  IN  NUMBER    DEFAULT  NULL, 
       format        IN  VARCHAR2  DEFAULT  'TYPICAL');
    */
    
    
    SQL> SELECT * FROM table (
      2     DBMS_XPLAN.DISPLAY_CURSOR('b7jn4mf49n569'));
     
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    SQL_ID  b7jn4mf49n569, child number 0
    -------------------------------------
    select o.name, u.name from obj$ o, type$ t, user$ u  where o.oid$ = t.tvoid and
    u.user#=o.owner# and  bitand(t.properties,8388608) = 8388608 and
    (sysdate-o.ctime) > 0.0007
    Plan hash value: 4266358741
    --------------------------------------------------------------------------------
    | Id  | Operation                     | Name    | Rows  | Bytes | Cost (%CPU)| T
    --------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT              |         |       |       |    94 (100)|
    |   1 |  NESTED LOOPS                 |         |     1 |    72 |    94   (2)| 0
    |   2 |   NESTED LOOPS                |         |     1 |    56 |    93   (2)| 0
    |*  3 |    TABLE ACCESS FULL          | OBJ$    |    71 |  2414 |    37   (3)| 0
    |*  4 |    TABLE ACCESS BY INDEX ROWID| TYPE$   |     1 |    22 |     1   (0)| 0
    |*  5 |     INDEX UNIQUE SCAN         | I_TYPE2 |     1 |       |     0   (0)|
    |   6 |   TABLE ACCESS CLUSTER        | USER$   |     1 |    16 |     1   (0)| 0
    |*  7 |    INDEX UNIQUE SCAN          | I_USER# |     1 |       |     0   (0)|
    --------------------------------------------------------------------------------
     
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       3 - filter(("O"."OID$" IS NOT NULL AND SYSDATE@!-"O"."CTIME">.0007))
       4 - filter(BITAND("T"."PROPERTIES",8388608)=8388608)
       5 - access("O"."OID$"="T"."TVOID")
       7 - access("U"."USER#"="O"."OWNER#")
     
    29 rows selected
     
    SQL> 
    As you can see using DBMS_XPLAN. DISPLAY_CURSOR. I can view the plan to explain any query in SQL * MORE.
    But I want to write a PL/SQL function generating a plan to explain for any query and display of the plan to explain in a HTML page
    How can I do the same thing in pl/sql? I need your advice.

    Thanks in advance!

    Better use a loop FOR:

    BEGIN
     htp.htmlopen ();
     htp.headopen ();
     htp.title ('My First Page');
     htp.headclose ();
     htp.bodyopen ();
     htp.tableopen ();
    
     FOR rc IN (SELECT PLAN_TABLE_OUTPUT FROM TABLE (dbms_xplan.display()))
     LOOP
      htp.tablerowopen ();
      htp.tabledata (rc.plan_table_output);
      htp.tablerowclose ();
     END LOOP;
    
     htp.tableclose ();
     htp.bodyclose ();
    
     htp.htmlclose ();
    END;
    
  • Reg: Explain the Plan-

    Hi Experts,

    I had a doubt about the Plan to explain it.

    Is there a relationship between the cost amount in the Plan to explain and the number of lines read by the query?
    In other words - if the number of lines read by the query increases, which will increase the cost also?

    Can someone please give me some advice on this?


    Thank you and best regards,
    Vanessa B.

    ranitB wrote:
    Hi Experts,

    I had a doubt about the Plan to explain it.

    Is there a relationship between the cost amount in the Plan to explain and the number of lines read by the query?
    In other words - if the number of lines read by the query increases, which will increase the cost also?

    Can someone please give me some advice on this?

    "The answer is 'not really' the cost is single block read disc of research time. But if the number of lines that are expected + coming in overall result are higher, the work expected by Oracle would be also higher. Thus, indirectly, the answer may be Yes. That said, the number of rows contained in the plan of the explain command (you should check the execution plan, explain plan is not the real plan) are the lines that the optimizer is expected to pick up and extracted from the number ofrows real may or may not match with her.

    Aman...

  • Explain the plan of a function?

    Hi people;

    I am running Oracle 11 g 11.2.0.3.
    Is it possible to get the plan of "explaining" execution of a function?

    Thx for your knowledge, looks.

    Hello

    dbms_profiler is really simple, it does not really require a tutorial.

    dbms_profiler.start_profiler;
    
    dbms_profiler.stop_profiler;
    

    That's all. The only thing that can take you a bit is the display of the results
    tables of % plsql_. Google will give you many links to examples, for example this one:

    http://www.toadworld.com/knowledge/KnowledgeXpertforOracle/tabid/648/TopicId/PROF7/default.aspx

    Best regards
    Nikolai

  • Generation to EXPLAIN the PLAN on a database that is open in READ ONLY mode

    Hello

    I use the Oracle 10.2.0.3 version.

    If my database is opened in READ ONLY mode, means that no insert/update/delete operations are allowed here.

    During the generation of the PLAN to EXPLAIN this, the PLAN_TABLE registrations for any SQL. But my database is opened in READ ONLY mode, means that no inserts can happen.

    So, how can I generate EXPLAIN PLAN for my SQL in this State?

    Thanks in advance.



    Best regards
    oratest

    oratest wrote:
    I use the Oracle 10.2.0.3 version.

    If my database is opened in READ ONLY mode, means that no insert/update/delete operations are allowed here.

    During the generation of the PLAN to EXPLAIN this, the PLAN_TABLE registrations for any SQL. But my database is opened in READ ONLY mode, means that no inserts can happen.

    So, how can I generate EXPLAIN PLAN for my SQL in this State?

    You can always do: 'explain the plan in some_table@remote_database' to avoid inclusion in the local database. Unfortunately 10g added an extraction of the sequence of the code "explain plan", and that's where the call fails if you have tried this distant approach on your version.

    Here's an idea that I have not tested. If you configure a link of data to your database from production to the database read-only, you could then do a "explain plan" in the database of production for the SQL statement by changing each object reference in the SQL statement to "object@readonlydatabase". In most cases this will allow the optimizer to recognize the statement as "entirely to distance" and get the optimizer on the readonly database to create the execution plan - which will be then written into the production database.

    Concerning
    Jonathan Lewis

  • explain the plan using plan_hash_value and runtime

    Hello

    Please let me know the syntax to get the plan to explain using sql_id and plan_hash_value.

    Also let me know how to find out the same sql execution times in the previous months. I have the ID value of sql.

    Kind regards

    VN

    > Is it possible to check how long the sql finished in the previous months?

    Of AWR / StatsPack reports.

    Or use awrsqrpt.sql which can query the repository for a single SQL_ID AWR.

    However, you must have the AWR data kept for 4 months.  The default retention is 7 days.

    Hemant K Collette

  • Explain the Plan of DBA_HIST_SQL_PLAN

    Hello

    I have the SQL_ID of a poor performing stmt of sql and I need to get the plan to explain the same DBA_HIST_SQL_PLAN.

    Please let me how can know I generate an explain plan of DBA_HIST_SQL_PLAN using sql_id.

    Kind regards

    VN

    That's fine - the service is available in this version.  (I asked because I thought that might be a function g 11 - but I just checked, and it's in 10 gr 2 as well).

    Concerning

    Jonathan Lewis

  • Explain the Plan in SQL Developer vs SQLPlus

    Hello world

    I have a small question. Why a plan explain blocking in SQL Developer but return immediately in sqlplus?

    For example, in SQL developer, I write my statement and use the F6 command to bring up the plan to explain it and just, it hangs and crashes. It seems he's trying to produce a plan to explain, but it worked for hours now.

    When I log into SQL Plus, I do a
    SQL> explain plan for <query>:
    SQL> select * from table(dbms_xplan.display);
    The whole process takes less than a minute to get the plan of the explain command.

    Is there something fundamentally different running through SQL Developer?

    Thank you!

    -Joe

    Joe,

    F6 in SQL Developer runs an AutoTrace, which is currently running the SQL and also shows schedules and terms of the explain command. If you only want the plan of the explain command, use F10.

    Kind regards
    Bob

  • Windows Movie Maker - releasing only audio, is it possible to publish the exact length of the audio and does not include the lot of silent at the end?

    Windows Movie Maker - have 6 minutes of audio spliced, I would like to publish in the form of an audio clip with no video.  I heard that this is possible, and it all works, the 'framework' includes 6 more minutes of space without air circulation that gets compiled with the planned 6 minutes of audio matching 12 minutes of audio rather than the 6 minutes.  Is it possible to MovieMaker 'See' the end of my audio instend, to include 12 minutes in length with it default?  Should I include photos or video for the project to publish only 6 minutes, instead of the 12 minutes?   I hope this makes sense...

    I assume you are using Vista Movie Maker 6 and not Live Movie Maker?

    It is a problem that I've not seen before... the recorded length must be equal
    at times combined clips on the timeline. I guess it's possible
    If you've done a lot of editing/trimming clips... something was corrupted.

    I was wondering... If you import the .wma file saved in Movie Maker and drag
    it to the timeline... it shows the clip as being the length of 12 minutes? If it isn't...
    Perhaps you could he split and right click Delete unwanted 6 minutes and
    then re-save.

    Divide... drag the playback at the end of the music and the type indicator... CTRL + L
    .. .to split the file then right-click of the unwanted part and click on delete.

    Tip: Unlike clips video... audio clips can be dragged to the timeline, so don't forget
    they are dragged all the way to the left to prevent air from dead at the beginning or
    between the clips.

    It may be worth trying to go to... Tools / Options / compatibility... tab and the left click
    the "All default settings" button before the Save.

    And... If the clips audio source are not the. WMA format... it could be a useful
    try to convert them to WMA before you import into Movie Maker.

  • Hello, I'm willing to give up my bundle of photography (Photoshop + Lightroom) project. I tried to do if however the plan itself does not appear here, be as creative cloud storage and on that there do not cancel option when you manage the plan. Its defini


    Hello, I'm willing to give up my bundle of photography (Photoshop + Lightroom) project. I tried to do if however the plan itself does not appear here, be as creative cloud storage and on that there do not cancel option when you manage the plan. Its really here because I'm still charged monthly for it. Any cancellation help please?

    Cancel see answer #1 in https://forums.adobe.com/thread/2023066 - includes a link to Chat from Monday to Friday

    -or directly at this link https://helpx.adobe.com/creative-cloud/help/cancel-membership.html

  • Does not include the webclips in a profile on a shared iPad

    In our shared environment of iPad, I am not able to include the webclips to configuration profiles. If I understand those, the configuration profile will always fail to install. In the past, we have had no problem doing this, this problem came only since we recorded our iPads as 'shared '.

    I am including the webclips in standard settings per device group.

    I monitor something?

    Hey, I have this problem also.  I have a profile with just a webclip and it fails with the error code 4001 MCInstallationErrorDomain.  My supplier MDM said that the profile must be a limited user profile, but there is no option of payload web clip when I try to set up a limited user profile.  So far, my MDM said it could be a UI thing and it is available and just do not show on the page, or they just have not written the code yet.  Anyway, I couldn't make it work again.

    I'm just wondering if you found a solution yet.

  • Mozilla, your last update does not include the last cert of intermediaries of extended validation from Verisign, Symantec class 3 EV SSL CA - G2, please fix ASAP

    Your last update of firefox, Mozilla does not include the last cert of intermediaries of extended validation from Verisign, Symantec class 3 EV SSL CA - G2, please fix ASAP

    Firefox never includes the intermediate certificates.
    It is the responsibility of a server to include all the intermediate certificate required to make it possible to build a certificate chain that ends with a trusted root certificate embedded.

    Note that Firefox automatically records the intermediate certificates that servers send in certificates for future use Manager (they appear labelled as 'Software security device' in the References tab).
    If a server does not send a complete certificate chain then you get an untrusted error when Firefox has stored missing intermediate certificates to visit a server in the past that a send it, but you get an untrusted error if this intermediate certificate is not yet registered.

  • I've recently updated my Apple ID (including the change of password). However, could not connect to iTunes to update the applications or make purchases. Any help?

    I've recently updated my Apple ID (including the change of password). However, could not connect to the iTunes Store to update the applications or make purchases. Any help?

    Have you tried a forced reboot? Hold down the home and Sleep/Wake buttons simultaneously for about 15-20 seconds , until the Apple logo appears. You won't lose anything.

    Then sign out of the iTunes Store and reconnect.

Maybe you are looking for

  • How to do a FACTORY RESET?

    I want to completely ERASE my triumph as if it were out of the box again. What are the steps? Please let me know! Also, I ran Gingerbreak on the phone and then run one-root' is this going to cause a problem? I didn't not remove all apps from the fact

  • no internet tv after installation of the usb tv tuner!

    I recently bought a HP laptop g62-228 ca series. I had set up the center of windows media, (no problem in doing so). I was able to open/Internet t.v and view them (especially short video clips / some full episodes, very crisp clear picture.) a lot of

  • Port USB3 log out when they are affected

    The USB connected to the computer sometimes disconnects unintensionally. Especially if you plug it into the port USB3 is affected (slightly tilted on the side). Is there something to do about it?

  • Should I upgrade to Webworks 2.0?

    I recently finished my jQuery HTML 5 application using the older version 1.0.4 SDK and come to know that Webworks 2.0 Beta is out. If I submit my application with the old version of the SDK, it will work correctly on Blackberry 10.2 or not? Is it com

  • US Cellular T-Mobile blackBerry smartphones

    We have US Cellular for T-Mobile, I'm looking to go to a BB Bold 9700, can someone tell me, "BOLD" running OS 6?