Query cost is changing when used in a VO

Hi All
I have created the view with the below query
SELECT component_item_name segment1,component_item_id inventory_item_id,organization_id,assembly_item_id
FROM BOMFG_BOM_COMPONENTS WHERE organization_id = :1
AND NVL(END_EFFECTIVE_DATE,SYSDATE ) >= SYSDATE
AND EXISTS
( SELECT 1
FROM apps.fnd_common_lookups fcl, mtl_system_items_b msi
WHERE fcl.lookup_type = 'ITEM_TYPE' AND msi.item_type = fcl.lookup_code
AND msi.inventory_item_id = component_item_id AND msi.organization_id = :2
AND msi.item_type IN ('ATO','OPTIONAL FEAT')
) START WITH assembly_item_id = :3 CONNECT BY PRIOR component_item_id =assembly_item_id GROUP BY component_item_name,component_item_id,organization_id,assembly_item_id
The cost of the above query is just 13 .
attached this VO with one LOV in my page.
when query gets executed while openign the page , the OA Framework is taking above query as
select * from (SELECT component_item_name segment1,component_item_id inventory_item_id,organization_id,assembly_item_id
FROM BOMFG_BOM_COMPONENTS WHERE organization_id = :1
AND NVL(END_EFFECTIVE_DATE,SYSDATE ) >= SYSDATE
AND EXISTS
( SELECT 1
FROM apps.fnd_common_lookups fcl, mtl_system_items_b msi
WHERE fcl.lookup_type = 'ITEM_TYPE' AND msi.item_type = fcl.lookup_code
AND msi.inventory_item_id = component_item_id AND msi.organization_id = :2
AND msi.item_type IN ('ATO','OPTIONAL FEAT')
) START WITH assembly_item_id = :3 CONNECT BY PRIOR component_item_id =assembly_item_id GROUP BY )component_item_name,component_item_id,organization_id,assembly_item_id
and the query cost becomes 21000 .
Because of this, VO takes longer than expected time .
pls suggest how can I handle this ,
Thanks
Naveen
Edited by: user640347 on Mar 10, 2010 12:27 AM

Hi,
Just tell me one thing you execute the query at backend after providing the inputs.
now again after the page has loaded and then again execute the lov query at backend with same input
variables.
Now if the query is same then how can the cost differ?
Verify it.
Thanks,
Gaurav

Similar Messages

  • Look for a progarm that will let me have 2 moniters but one will lock on and will not change when using spaces

    look for a progarm that will let me have 2 moniters but one will lock on and will not change when using spaces

    ok so i have one moniter to the right of me and i want to keep my google chrome on that one but still be abel to use space on the many monter. cuz when you go to spaces it movies both moniter i hope that help and i hope that you can help me.

  • Is it possible to ignore "Rigid relationships between attributes cannot be changed" when using ProcessUpdate for Dimension?

    As per the title is it possible to ignore "Rigid relationships between attributes cannot be changed" when using ProcessUpdate for Dimension?
    We have a case where very rarely an item might have been miscategorised so the brand is manually changed.  We want this dimension to be rigid to speed up ProcessUpdate.
    We do a ProcessFull each night, so it will get corrected then, but during the hourly updates we would just like to ignore this error if possible?

    Hello,
    The rigid relationship should be defined when the members will not change over time. Here are some threads regarding rigid relationship for your reference, please see:
    Processing OLAP Cube: http://social.technet.microsoft.com/Forums/sqlserver/en-US/17a55593-9543-404e-a579-0a011965585d/processing-olap-cube?forum=sqlanalysisservices
    Flexible and rigid relationship: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/2d8f5443-065d-4485-9385-6f0b5fa417da/flexible-and-rigid-relationship?forum=sqlanalysisservices
    If you have any feedback on our support, please click
    here.
    Regards,
    Elvis Long
    TechNet Community Support

  • Plan changing when using variables instead of constant

    Hi,
    I have a query, when run with the constant values uses a better plan. But when these constants are replaced with variables, plan is changing and taking much longer time to complete. I don't want the query to use a different plan when using the variables in place of constants.
    Please help.
    Thanks

    Probably you got caught by bind variable peeking (if the plans are same for both variables)
    If you have default 10g Statistics gathering job it means you are collecting histograms
    If my bind peeking + histogram assumption is true Check this link to fight with peeking
    http://www.pythian.com/news/867/stabilize-oracle-10gs-bind-peeking-behaviour-by-cutting-histograms
    if deleting histograms doesnt help
    check this link
    http://www.oracloid.com/2006/07/bind-variable-peeking-with-no-histograms/
    A. Coskan GUNDOGAR
    Oracle DBA
    http://coskan.wordpress.com
    ““Knowledge is of no value unless you put it into practice.”.”
    Anton Chekhov

  • Sound Preferences Changed when using HDMI - Yosemite

    Mid 2010, 27'' iMac
    3.6 GHz Intel Core i5
    14G RAM
    When using the HDMI output (from my iMac, into my Lenovo laptop) my default sound output preferences are being changed since upgrading to Yosemite.
    I have an external sound card for my monitor speakers. the sound card is my default in and output.
    When I insert the HDMI into my laptop (and use the iMac as an external monitor for my laptop) Yosemite changes the default sound output to the iMac internal speakers.  I've used the keyboard to (cmd + F2) and toggled between the laptop external display and iMac home screen and can see the sound output changed to internal speakers)
    Appreciate this is quote a specific issue
    Any ideas if there is a work around for this?
    CT

    Hi,
    Please try this first to enable Speakers in Playback devices as follows:
    1. Right click speaker icon (bottom right hand corner)
    2. Select Playback devices
    3. Right click HDMI sound
    4. Enable it
    5. Click Apply/Ok
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Color space change when using photoshop elements plug in

    When I select photo and edit with photoshop elements, Aperture makes a copy of the file as expected, but I can see the image color/hue etc. has changed, why?  Is there some setting I am missing?  The color of the image shouldn't change, should it? Just doesn't make sense!

    Where do you see the color change of the copy?
    In the thumbnail or preview before it is send to the external edtor?
    When the image is opened in the external editor?
    Or after it is send back from the editor?
    I do not see any color changes when I use PS CS5; it may help to see a screenshot.

  • Orcl:query-database gives error when using to_char function in select stmt

    hi
    Use Case : We get a csv file ("bank_import_<MMDDYYYYY>.csv") from the bank containing the transactions occured for the month. The date in the filename is retrieved into string and i need to convert this string to the format "MON-DD-YYYY". This is the required format for an header table which takes this string as primary key.
    Code:
    statement_name = '11302206'.........
    <copy>
    <from expression="concat("'select to_char(to_date('",bpws:getVariableData('statement_name') ,"','MMDDYYYY'),'MON-DD-YYYY') from dual'")"/>
    <to variable="xpath"/>
    </copy>
    <copy>
    <from expression="orcl:query-database(bpws:getVariableData('xpath'),false(),false(),'jdbc:oracle:thin:apps/apps@croaker:1529:RSICMI')"/>
    <to variable="statement_name"/>
    </copy>
    Error:
    [2006/12/06 19:13:04] Updated variable "xpath" less
    <xpath>'select to_char(to_date('10302006','MMDDYYYY'),'MON-DD-YYYY') from dual'</xpath>
    [2006/12/06 19:13:04] "XPathException" has been thrown. less
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "orcl:query-database(bpws:getVariableData("xpath"), false(), false(), "jdbc:oracle:thin:apps/apps@croaker:1529:RSICMI")", the reason is .
    Please verify the xpath query.
    Log Message:
    <2006-12-06 19:13:04,595> <DEBUG> <UAT.collaxa.cube.xml> <XPathUtil::evaluate> XPathQuery[concat("'select to_char(to_date('", bpws:getVariableData("statement_name"), "','MMDDYYYY'),'MON-DD-YYYY') from dual'")], XPath Result: class=java.lang.String value='select to_char(to_date('10302006','MMDDYYYY'),'MON-DD-YYYY') from dual'
    <2006-12-06 19:13:04,595> <DEBUG> <UAT.collaxa.cube.xml> <XPathUtil::initXPath> namespaceMapping is: rootMap: {bpws=http://schemas.xmlsoap.org/ws/2003/03/business-process/, xp20=http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20, ns4=http://xmlns.oracle.com/pcbpel/adapter/db/top/BAIBankUpload, ldap=http://schemas.oracle.com/xpath/extension/ldap, xsd=http://www.w3.org/2001/XMLSchema, ns5=http://xmlns.oracle.com/pcbpel/adapter/file/, client=http://xmlns.oracle.com/BAI_BankUpload, ora=http://schemas.oracle.com/xpath/extension, ns1=http://xmlns.oracle.com/pcbpel/adapter/file/readBAIBankImportCSV/, ns3=http://TargetNamespace.com/readBAIBankImportCSV, ns2=http://xmlns.oracle.com/pcbpel/adapter/db/Insert_SI_CE_STATEMENT_LINES_INT/, bpelx=http://schemas.oracle.com/bpel/extension, orcl=http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc, =http://schemas.xmlsoap.org/ws/2003/03/business-process/}
    scopedMap: {}
    <2006-12-06 19:13:04,751> <DEBUG> <UAT.collaxa.cube.xml> <XPathUtil::evaluate> XPathQuery :orcl:query-database(bpws:getVariableData("xpath"), false(), false(), "jdbc:oracle:thin:apps/apps@croakercom:1529:RSICMI")
    org.collaxa.thirdparty.jaxen.FunctionCallException
         at org.collaxa.thirdparty.jaxen.FunctionCallException.fillInStackTrace(FunctionCallException.java:124)
         at java.lang.Throwable.<init>(Throwable.java:195)
         at java.lang.Exception.<init>(Exception.java:41)
         at org.collaxa.thirdparty.jaxen.saxpath.SAXPathException.<init>(SAXPathException.java:83)
         at org.collaxa.thirdparty.jaxen.JaxenException.<init>(JaxenException.java:82)
         at org.collaxa.thirdparty.jaxen.FunctionCallException.<init>(FunctionCallException.java:86)
         at oracle.tip.pc.services.functions.ExtFuncFunction$QueryDatabaseFunction.call(ExtFuncFunction.java:190)
         at org.collaxa.thirdparty.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:184)
         at org.collaxa.thirdparty.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:107)
         at org.collaxa.thirdparty.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:724)
         at org.collaxa.thirdparty.jaxen.BaseXPath.selectNodes(BaseXPath.java:253)
         at org.collaxa.thirdparty.jaxen.BaseXPath.evaluate(BaseXPath.java:210)
         at com.collaxa.cube.xml.xpath.XPathUtil.evaluate(XPathUtil.java:93)
         at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.evalFromValue(BPELAssignWMP.java:501)
         at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.__executeStatements(BPELAssignWMP.java:122)
         at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:188)
         at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3408)
         at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1836)
         at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:166)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:252)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5438)
         at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1217)
         at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:511)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:335)
         at ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.handleInvoke(ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.java:1796)
         at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    Root cause:
    java.lang.ClassCastException
         at oracle.tip.pc.services.functions.ExtFuncFunction$QueryDatabaseFunction.call(ExtFuncFunction.java:158)
         at org.collaxa.thirdparty.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:184)
         at org.collaxa.thirdparty.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:107)
         at org.collaxa.thirdparty.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:724)
         at org.collaxa.thirdparty.jaxen.BaseXPath.selectNodes(BaseXPath.java:253)
         at org.collaxa.thirdparty.jaxen.BaseXPath.evaluate(BaseXPath.java:210)
         at com.collaxa.cube.xml.xpath.XPathUtil.evaluate(XPathUtil.java:93)
         at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.evalFromValue(BPELAssignWMP.java:501)
         at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.__executeStatements(BPELAssignWMP.java:122)
         at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:188)
         at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3408)
         at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1836)
         at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:166)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:252)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5438)
         at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1217)
         at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:511)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:335)
         at ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.handleInvoke(ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.java:1796)
         at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    <2006-12-06 19:13:04,751> <ERROR> <UAT.collaxa.cube.xml> ORABPEL-09500
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "orcl:query-database(bpws:getVariableData("xpath"), false(), false(), "jdbc:oracle:thin:apps/apps@croaker:1529:RSICMI")", the reason is .
    Please verify the xpath query.

    Hi,
    QAbdul wrote:
    when I tried to execute the followingin XMLQuery by calling TO_CHAR() whithin this query I am getting this error"ORA-19237: XP0017 - unable to resolve call to function - fn:TO_CHARTO_CHAR is a SQL function, XQuery is unaware of it.
    XPath 2.0 specifications define a fn:format-date function but Oracle has not included yet in its XQuery implementation.
    Easiest way to go is A_Non's solution, but if you need to format at multiple places in the query, you can declare a local XQuery function.
    For example, to format to "DD/MM/YYYY" from the canonical xs:date format "YYYY-MM-DD" :
    {code}
    declare function local:format-date($d as xs:date) as xs:string
    let $s := xs:string($d)
    return concat(
    substring($s, 10, 2), "/",
    substring($s, 7, 2), "/",
    substring($s, 2, 4)
    {code}
    and an example of use :
    {code}
    SQL> CREATE TABLE test_xqdate AS SELECT sysdate dt FROM dual;
    Table created
    SQL> SELECT *
    2 FROM XMLTable(
    3 'declare function local:format-date($d as xs:date) as xs:string
    4 {
    5 let $s := xs:string($d)
    6 return concat(
    7 substring($s, 10, 2), "/",
    8 substring($s, 7, 2), "/",
    9 substring($s, 2, 4)
    10 )
    11 }; (: :)
    12 for $i in ora:view("TEST_XQDATE")/ROW/DT
    13 return element e {
    14 attribute xs_date_format { $i/text() },
    15 attribute local_format { local:format-date($i) }
    16 }'
    17 COLUMNS
    18 xs_date_format VARCHAR2(10) PATH '@xs_date_format',
    19 local_format VARCHAR2(10) PATH '@local_format'
    20 )
    21 ;
    XS_DATE_FORMAT LOCAL_FORMAT
    2010-10-28 28/10/2010
    {code}

  • Derby db named query causes parse error when using derby db MONTH function

    Hi all!
    I'm trying to create an application using the persistance api and beans binding. I have created my database and entity classes.
    My problem is creating a named query that uses some of the functionality from the derby database (which is embedded in the application).
    I have a named query:
    @NamedQuery(name = "Vehicles.findbymotmonth", query = "SELECT v FROM Vehicles v WHERE MONTH(v.lastmotdate) = :monthnumber") The actual query works fine when I send it directly to the db (with the parameter filled in) but causes an exception when used as a named query:
    Local Exception Stack:
    Exception [TOPLINK-8025] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.EJBQLException
    Exception Description: Syntax error parsing the query [Vehicles.findbymotmonth: SELECT v FROM Vehicles v WHERE MONTH(v.lastmotdate) = :monthnumber], line 1, column 32: unexpected token [MONTH].
    Internal Exception: line 1:32: unexpected token: MONTH
            at oracle.toplink.essentials.exceptions.EJBQLException.unexpectedToken(EJBQLException.java:389)
    ... I've tried looking for solutions online but it seems evryone just writes up the original java db application example provided by sun and no one has tried doing more than "select c from customers c".
    I'm using the netbeans ide (6.5).
    Please tell me there is a simple solution to this and the persistance API can handle complex queries!
    Thanks in advance.

    one solution: assume the toplink library to be so full of bugs as to be unusable and switch to the hibernate persistance manager where it works fine.
    Edited by: pointer2null on Feb 17, 2009 11:02 AM

  • Project changes when using different pc's

    ok i had using pro 4 a project saved on  pc one
    i then opened it up on another pc [pc 2] where i added some title pages
    then saved the project on pc2 and copied the whole saved folder back to pc one
    when i opened the copied project on pc one [using pc one] the title fonts have changed
    is there some issue when using more than one pc to work on one project ???
    oh i forgot pc one = win xp and pc2 = windows 7 !!!
    cheers

    ok the font used was MV Boli
    on both pc when i look in titler they both say MV Boli
    they just look totaly different
    other thing different between the two is :-  the font templates used and saved on pc 2
    are not showing up when opend on pc 1

  • Some icloud contacts changes when using mail in lion

    I'm using icloud contacts on my iphone ios6 ipad ios6 and macbook 10.7.
    All contacts are sorted by forename and last name in one line like -Steve Jobs- in one line
    Some of my contacs changes when sending mail from mail 5.3 on my macbook.
    It adds an extra last name and my icloud looks like -Steve Jobs-Jobs-.
    and the contact gets sortet by letter j insted of s.
    My mail is setup to sync gmail (mail only).
    I have no other sync for contacts than icloud.
    I located the problem to my mac so I deleted all accounts and restarted mail.
    But promblem remains.
    Is it possible to completly delete mail and all settings from libary and start fresh?

    oldcdr wrote:
    I'm not sure what the sender is using.
    I wouldn't think that would matter.  Does Keynote still work on that Mac?  Try this: Drag such an attachment out of a mail message, select the file, then do a Finder File > Get Info.  What is the setting for "Open with"?  If it's not Keynote and you'd like Keynote to open all .pps files, select Keynote in the list, then click the "Change All" button.

  • Page culture changes when using AsyncPostBackTrigger

    In my web application I have used an asp timer and a AsyncPostBackTrigger, and in content template I use a datagrid. and in timer
    tick event I update the grid, when using the AsyncPostBackTrigger, the culture of the datagrid changes to default, how can i avoid this?

    Please post questions related to ASP.NET in the ASP.NET forums (http://forums.asp.net ).

  • Index Usage in 9i changed  when used rownum

    Hi List,My Application is in RBO
    Here is one more brain twister ?
    Assume following I Have table SHRI with a single column
    COL I have created Index on COL column say IND_COL.
    Now when I run Following query on 8i with AUTOTRACE ON
    I can see that 8i Uses the Index IND_COL Clearly .
    select * from shri where (h_name='ABC' or h_name='BOM')
    or (h_name ='BOM' or h_name='MOM')
    and rownum=1
    select * from shri where (COL='ABC' or COL='BOM')
    or (COL='ABC' or COL='BOM')
    and rownum=1
    (Note:Above example is just for ur understanding plz.dont see the usage)
    Now my problem is when I see the explain plan for above query in 8i I can see that Query uses IND_COL .
    But when I run the same in 9i It does not uses IND_COL Index (Strange!!!) .
    However when I remove "and rownum=1" clause then It again uses the index in 9i.
    Assume that such queries are existing many places .
    I am badly stuck because of this problem can anybody suggest the best way (Other than changing RBO to CBO) ?
    Regards
    Sripad.

    Run below query, you will get all the details of tablespaces.
    col "Tablespace" for a22
    col "Used MB" for 99,999,999
    col "Free MB" for 99,999,999
    col "Total MB" for 99,999,999
    select df.tablespace_name "Tablespace",
    totalusedspace "Used MB",
    (df.totalspace - tu.totalusedspace) "Free MB",
    df.totalspace "Total MB",
    round(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace))
    "Pct. Free"
    from
    (select tablespace_name,
    round(sum(bytes) / 1048576) TotalSpace
    from dba_data_files
    group by tablespace_name) df,
    (select round(sum(bytes)/(1024*1024)) totalusedspace, tablespace_name
    from dba_segments
    group by tablespace_name) tu
    where df.tablespace_name = tu.tablespace_name ;

  • Query taking too long when using bind variable

    Hi All,
    There is a query in our prod DB which runs very slow (approx 2 hours) when it uses Bind Variables (using JDBC thin client), and when i try passing the variable using TOAD/SQL developer it runs fine.
    Explain Plan for running Query
    SELECT STATEMENT ALL_ROWSCost: 146 Bytes: 379 Cardinality: 1                                                   
         21 SORT ORDER BY Cost: 146 Bytes: 379 Cardinality: 1                                              
              20 NESTED LOOPS Cost: 145 Bytes: 379 Cardinality: 1                                         
                   17 HASH JOIN Cost: 22 Bytes: 42,558 Cardinality: 123                                    
                        15 MERGE JOIN CARTESIAN Cost: 15 Bytes: 8,910 Cardinality: 27                               
                             12 FILTER                          
                                  11 NESTED LOOPS OUTER Cost: 9 Bytes: 316 Cardinality: 1                     
                                       8 NESTED LOOPS OUTER Cost: 8 Bytes: 290 Cardinality: 1                
                                            5 NESTED LOOPS Cost: 6 Bytes: 256 Cardinality: 1           
                                                 2 TABLE ACCESS BY GLOBAL INDEX ROWID TABLE GDP.GDP_FX_DEALS_INCREMENTOR Cost: 4 Bytes: 28 Cardinality: 1 Partition #: 9 Partition access computed by row location     
                                                      1 INDEX RANGE SCAN INDEX GDP.GDP_FX_DEALS_INC_IDX_01 Cost: 3 Cardinality: 1
                                                 4 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_FX_DEALS Cost: 2 Bytes: 228 Cardinality: 1      
                                                      3 INDEX UNIQUE SCAN INDEX (UNIQUE) GDP.GDP_FX_DEALS_KEY Cost: 1 Cardinality: 1
                                            7 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_FX_DEALS Cost: 2 Bytes: 34 Cardinality: 1           
                                                 6 INDEX UNIQUE SCAN INDEX (UNIQUE) GDP.GDP_FX_DEALS_KEY Cost: 1 Cardinality: 1      
                                       10 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_COUNTERPARTIES Cost: 1 Bytes: 26 Cardinality: 1                
                                            9 INDEX UNIQUE SCAN INDEX (UNIQUE) GDP.PK_CPTY Cost: 0 Cardinality: 1           
                             14 BUFFER SORT Cost: 14 Bytes: 448 Cardinality: 32                          
                                  13 TABLE ACCESS FULL TABLE GDP.GDP_CITIES Cost: 6 Bytes: 448 Cardinality: 32                     
                        16 TABLE ACCESS FULL TABLE GDP.GDP_AREAS Cost: 6 Bytes: 2,304 Cardinality: 144                               
                   19 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_PORTFOLIOS Cost: 1 Bytes: 33 Cardinality: 1                                    
                        18 INDEX UNIQUE SCAN INDEX (UNIQUE) GDP.PORTFOLIOS_KEY Cost: 0 Cardinality: 1                               
    Explain Plan for Slow Query
    Plan
    SELECT STATEMENT ALL_ROWSCost: 11,526,226 Bytes: 119,281,912 Cardinality: 314,728                                                   
         21 SORT ORDER BY Cost: 11,526,226 Bytes: 119,281,912 Cardinality: 314,728                                              
              20 HASH JOIN Cost: 11,510,350 Bytes: 119,281,912 Cardinality: 314,728                                         
                   2 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_PORTFOLIOS Cost: 1,741 Bytes: 177,540 Cardinality: 5,380                                    
                        1 INDEX FULL SCAN INDEX (UNIQUE) GDP.PORTFOLIOS_KEY Cost: 14 Cardinality: 5,380                               
                   19 HASH JOIN Cost: 11,507,479 Bytes: 87,932,495,360 Cardinality: 254,140,160                                    
                        3 TABLE ACCESS FULL TABLE GDP.GDP_AREAS Cost: 6 Bytes: 2,304 Cardinality: 144                               
                        18 MERGE JOIN CARTESIAN Cost: 11,506,343 Bytes: 18,602,733,930 Cardinality: 56,371,921                               
                             15 FILTER                          
                                  14 HASH JOIN RIGHT OUTER Cost: 3,930,405 Bytes: 556,672,868 Cardinality: 1,761,623                     
                                       5 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_COUNTERPARTIES Cost: 6,763 Bytes: 892,580 Cardinality: 34,330                
                                            4 INDEX FULL SCAN INDEX (UNIQUE) GDP.PK_CPTY Cost: 63 Cardinality: 34,330           
                                       13 HASH JOIN OUTER Cost: 3,923,634 Bytes: 510,870,670 Cardinality: 1,761,623                
                                            10 HASH JOIN Cost: 2,096,894 Bytes: 450,975,488 Cardinality: 1,761,623           
                                                 7 TABLE ACCESS BY GLOBAL INDEX ROWID TABLE GDP.GDP_FX_DEALS_INCREMENTOR Cost: 2,763 Bytes: 52,083,248 Cardinality: 1,860,116 Partition #: 14 Partition access computed by row location     
                                                      6 INDEX RANGE SCAN INDEX GDP.GDP_FX_DEALS_INC_IDX_01 Cost: 480 Cardinality: 334,821
                                                 9 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_FX_DEALS Cost: 1,734,205 Bytes: 8,320,076,820 Cardinality: 36,491,565      
                                                      8 INDEX FULL SCAN INDEX (UNIQUE) GDP.GDP_FX_DEALS_KEY Cost: 104,335 Cardinality: 39,200,838
                                            12 TABLE ACCESS BY INDEX ROWID TABLE GDP.GDP_FX_DEALS Cost: 1,733,836 Bytes: 1,331,145,696 Cardinality: 39,151,344           
                                                 11 INDEX FULL SCAN INDEX (UNIQUE) GDP.GDP_FX_DEALS_KEY Cost: 104,335 Cardinality: 39,200,838      
                             17 BUFFER SORT Cost: 11,499,580 Bytes: 448 Cardinality: 32                          
                                  16 TABLE ACCESS FULL TABLE GDP.GDP_CITIES Cost: 4 Bytes: 448 Cardinality: 32                     
    How can I avoid that.
    Thanks

    Hello
    Could you reformat your execution plans because they aren't particularly readable. The forums allow you to preserve the formatting of code or output by putting the symbol {noformat}{noformat} before and after the section of text you want to preserve formatting for. 
    If you write
    {noformat}select * from v$version
    {noformat}
    it will be displayed asselect * from v$version
    So can you run this above statement and post the output here so we know the full oracle version you are working with?  And finally, it would be really helpful to see the query you are running.  When you say it runs fine in Toad, is that when you replace the bind variables with the values or are you also using bind variables in Toad?
    Cheers
    David                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Content Query not producing results when using [Me] filter

    Hi
    I'm using a Content Query web part and I'm trying to show the most recent document modified by each site user by applying it across the site collection and using the Filter, Modified By [_Hidden] equals [Me]. However, this doesn't seem to work for any user
    - the web part is always blank. I have tried different combinations such changing equals to contains, and using the Modified By field etc - nothing gives me the correct results. If I instead take the [Me] out and instead use the "people chooser"
    and set to a specific person then I seem to get the results I would expect - however I cannot hard code a given user.
    Does anyone know how to use [Me] correctly?
    Thanks

    Hi  sjb500,
    According to your description, please take steps as below to meet your demand:
    With the page layout open in Design view, double-click the Content Query Web Part.
    In the Content Query Web Part dialog box, click the plus sign (+) next to Query to expand it.
    In the Source section, click Show items from all sites in this site collection.
    In List Type section, in the Show items from this list type, click Document Library.
    In the Content Type section, in the Show items of this content type group list, click Document
    Content Types.
    In the Content Type section, in the Show items of this content type list, click Document.
    In the Additional Filters section, under Show Items When, click Modified By [_Hidden] in
    the first box, click Is Equal To in the second box, and then click [Me].
    In the Content Query Web Part dialog box, click the plus sign (+) next to Presentation to expand it.
    In the Grouping and Sorting section, in the Sort items by list, click Modified
    and Select Show items in descending order.
    Click OK.
    Reference:http://office.microsoft.com/en-us/sharepoint-designer-help/display-data-from-multiple-lists-with-the-content-query-web-part-HA010174134.aspx
    [Me] is a variable that stands for the user who is currently viewing the page that contains the Content Query Web Part in the browser.
    Here is some scenarios using [Me] in Content Query Web Part:
    http://social.technet.microsoft.com/Forums/en-US/346ffbe6-d7ba-467e-b7f5-6d6e289677a1/user-tasks-web-part
    Please inform me freely if you have any questions.
    Thanks

  • Presence status not changed when using Lync 2010 Remote Call Control

    Hello,
    I'm currently testing the Remote Call Control functionality of Lync 2010. Call management works fine but I'm surprised that my presence status does not change to "In a Call" when the call is established.
    OriginatedEvent, DeliveredEvent and EstablishedEvent are forwarded correctly to Lync Client 2010. All responses are "200 OK".
    Is there something more to send to Lync Server 2010 so the status of the Lync Client gets correctly updated to "In a Call" ? Or is a plugin for the Lync Client necessary to achieve this ?
    Thank you in advance,
    Martin

    I think there's something missing from your scenario and I don't believe you would need a plugin for this.  It's been forever since I've set up RCC with Lync 2010 however.  I know this isn't what you're looking for, but I've used this product in
    the past to configure Lync and RCC with third party PBXs that don't support Lync/RCC but do have a TAPI interface.
    http://www.estos.com/products/drivers-middleware/callcontrolgateway400.html I've been able to get a free trial before and it worked like a charm for an old 3COM phone system.  If you can get a trial it might help you compare apples to apples provided
    you have a TAPI driver for your PBX.
    For more details on what happens behind the scenes, you might have some better luck in the MSDN dev forums:
    http://social.msdn.microsoft.com/Forums/en-US/home?category=uc
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
    SWC Unified Communications
    This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Maybe you are looking for