index for a similar request with order of

Hello

I have a table with an ID number and the channels as follows:
CategoryParentChild
-----------------------------
parentId
childId
isFolder
parentPath
bookName
I want to get all the books whose parentPath begins with a string where a like clause.

I have an index on the table as such: (isFolder, parentPath, bookname)

My request is as follows, where the: likepath parameter will be something like "/ abc/def/%" and I want all the books whose parentPath starts with/abc/def /.
select pc.childId from CategoryParentChild pc
where pc.isFolder='F' and pc.parentPath like :likepath
order by pc.isFolder, pc.parentPath, pc.bookName
I guess that Oracle will see that my generic is only at the end of the: likepath parameter and use the indexes without doing a table scan. Is this true? IsFolder and parentPath are also the where clause arguments and parentPath and bookName are used in the order of. I hope so that Oracle uses not only the index to select books of candidates whose parentPath begins with a string of path, but also uses the same index to sort optimally. Does anyone know if I made the right choice with the ordered index? NOTE: it seemed that even if isFolder is always 'F' (false) in the query, it seems that I need it include redundantly in order by to ensure that Oracle can use the index to the place where both of the order of.

Thank you
Andy

If the Joker is at the end of the searched string, Oracle should consider using the index. If it does will depend on an estimate of the Oracle of the selectivity of the condition (i.e. WHERE parentPath AS ' / %' is going to be radically less likely than parentPath AS ' / abc/def/ghi/somethingElse/foo/%'). It can get a little complicated depending on the version of Oracle if the selectivity of the different search conditions is significantly different. If you're on 11g, adaptive cursor sharing helps a little. But on 10g, it is possible that the first person who executes the query enters a state very not selective, Oracle optimizes the query for this binding variable value, do a table scan, and then the future queries use the wrong path.

Justin

Tags: Database

Similar Questions

  • Windows experience index for two different laptops with the same configuration of maximum output power

    [I have two almost identical laptops Lenovo T61p and running W7 64 Ultimate b: has] has an Intel T7700 processor and 8 GB of RAM. [B] has a CPU of Intel T8300 with 4 GB of RAM. They are clocked at 2.6 GHz and have identical hard drives.

    When the system is running Windows Experience Index, it does to 2.6 GHz. It doesn't matter what is the result.

    When the system B runs the WEI, it becomes 780 MHz. In the end, he will return to run at 2.6 GHz. Needless to say that it will reduce its index to I / 2 of the other system. During any normal operation, the processor remains a 2.6 GHz

    All other values of the indices are similar and irrelevant.

    As far as I checked, the two system has the same configuration of power to maximum performance, I did not miss something. MSCONFIG are also identical.

    Any ideas about where to look to fix this behavior?

    See you soon

    Rolando

    WEI is a meaningless number that does not reflect anything in reality.  You win nothing in this hunt.  Because it is a useless number, that it has been deleted in windows 8

  • How do periodically for simultaneous calendar request with different parameters


    Hi team,

    I want to plan a competing application periodically, but want to pass parameters of different date for each series.

    Please help me.

    Thank you

    Anmisha.

    Hello

    Here is the solution I got plan a competing application periodically, but want to pass parameters of different date for each series:

    Tick "increment date settings performed."
    option.  If the application contains the date
    settings, choose ' Increment date settings each run' for the value.
    for this setting adjusted to match the new submission interval.   For example, if the value of the parameter
    on July 25, 1997 07:00 and the monthly interval, the setting is adjusted
    August 25, 1997 07:00 for the next presentation.

    Thank you

    Anmisha

  • Combine with a similar request has plunged to values

    Dear all,
    I have a report with the help of combined with a similar request. (Union)

    TableA
    Name in the amount of SAR

    TableB
    AMT name SAR

    Result column:
    Name salary

    My requirment in the result of salary column I have shoul use divided by 100.
    When I shot the fn button I am unable to see in the result column.
    How to divide 100 then Multipla with another column of result SAR

    Thank you
    Govind R

    Hello
    In order to divide the salary by 100, on each separately criteria under treatment fx.

    Kind regards
    Srikanth

  • Best preferences for queries to prefix with the index catalog (CTXCAT)

    Documentation for Oracle Text gives this example of a setting preferred prefix/substring for the index catalog and context:

    Start
    ctx_ddl.create_preference ('mywordlist', 'BASIC_WORDLIST');
    ctx_ddl.set_attribute ('mywordlist', 'PREFIX_INDEX', 'TRUE');
    ctx_ddl.set_attribute ('mywordlist', 'PREFIX_MIN_LENGTH', ' 3');
    ctx_ddl.set_attribute ('mywordlist', 'PREFIX_MAX_LENGTH', ' 4');
    ctx_ddl.set_attribute ('mywordlist', 'SUBSTRING_INDEX', 'YES');
    end;

    The SUBSTRING_INDEX attribute is really necessary if I only ever issue that research prefix, such as:

    Auction title SELECT FROM WHERE CATSEARCH (title, ' cam *', ") > 0;

    I'm not sure that you understand the difference between the PREFIX_INDEX and the SUBSTRING_INDEX.

    Substring is intended to speed up searches "double truncation", especially for the requirements specialist such as the research of the chemical name, where you want to search "% fluoro" or similar.

    It is NOT recommended for general use, because it significantly slows down indexing and makes the very much larger indices.

    Prefix allows you to speed up the search for right truncated simple searches such as '% of cam', but it's not normally necessary.

    For general use with middle office truncation and right (for example "oracl %" or "% key ora") I would not use one of these options. Double truncation or truncation on the left ("% racl %" or "% scrapes") should be avoided as far as possible - use of the wildcard character to start without the option of substring will cause a full table scan on the index table $I to find all words that match, given that the index can not be used with a wildcard to start.

  • Lost money after combine with a similar request

    Hi experts

    I used the option "combine with a similar request" to combine the 2 reports that have exactly the same columns.
    The only difference between them is that they use different filters.
    The action of the combine is made correctly but the sum over the years is missing
    When I run the 2 reports separately for each of them that the amount is shown in the report but when I combine it is absent.


    Can anyone explain why?

    Published by: aharrab_be on April 30, 2009 10:32

    who discovers that you are using. ?

    rule of sum game aggregation and try in privot... for this measure.

  • Combining a similar request for responses

    Hi all
    We strive to create reports using ' * combine similar request *' option, in which we are combining 2 different measures in different fields, but with the common dimension.
    Suppose if we have topics below.

    Subject to area A
    Measure - recipes
    Dimension - year

    Domain B
    Measures - units sold
    Dimension - year

    In this case, we expect to result as below
    Revenue units sold
    2008 1234 $10
    2007 $345 3


    but instead, we get the result as below

    Revenue units sold
    $2008 1234 0
    2008 0 10
    2007 345 $0
    2007-0-3


    I sit possible to get the above result?

    Kind regards
    Floquet

    Hello..

    In any case you do not get two straight lines for each year of law?
    According to you, you get nulls for any other measure...
    Have you applied aggregation rule > sum for both measures ?
    Do it and a report...

    Thank you & best regards
    Kishore Guggilla

  • Tried to open a PDF with Acrobat Pro Trial XI and sign popped up, I entered my username and password, but he doesn't answer his similar gray with the four points of rotation for ever. Any solution please?

    Tried to open a PDF with Acrobat Pro Trial XI and sign popped up, I entered my username and password, but he doesn't answer his similar gray with the four points of rotation for ever. Any solution please?

    Hi higi97,

    How are you connected to the internet? You're behind a corporate firewall particularly safe? You're on Mac or Windows? You have an anti-malware software running on your computer which can prevent applications other than your browser to connect to internet?

    You can try the steps below:

    1. close the application of creative cloud.

    2. navigate to the OOBE folder.

    Windows: [system drive]: \Users\ [user name] \AppData\Local\Adobe\OOBE

    Mac OS: /Users/ [user name] / folder/Library/Application Support / Adobe / OOBE

    3. delete the opm.db file.

    4. launch creative cloud.

    Let us know if this helps,

    Kind regards

    Rave

  • appropriate index for a query with 3 ands

    Hello

    I have the following table:

    PAGES
    ----------
    BOOK_ID DIMENSION BEGIN_POS END_POS PAGE_TEXT

    where book_id is 64-bit, size is 32 - bit, begin_pos is 32 - bit, end_pos is 32 - bits and page_text is a blob (UTF-8)

    My query is:

    Select * from PAGES
    where BOOK_ID = 1234 and DIMENSION = - 2 and BEGIN_POS < = 10000 and 10000 < END_POS

    Who will not fail to return 1 result.

    My question is what kind of clues or index (multi-column?) do need me to this query with WHERE clause uses 4 columns?

    Thank you
    Andy

    user9990110 wrote:
    My only guess is to create an index (book_id, dimension, begin_pos) and another (book_id, dimension, end_pos), but this seems a little strange.

    In your case, I would prefer an ITO - your BLOB is stored in the segment of overflow (outside of and apart from the index structure in itself ). With an IOT, each query will effectively use the index, and I wish to create two indexes on a table of 5 columns (relatively large overhead). Although compare of course.

  • "To view this page, Firefox must send information that will repeat any action (for example, a search or order confirmation) that was carried out earlier."

    To view this page, Firefox must send information that will repeat any action (for example, a search or order confirmation) that was carried out earlier. Then I have to click on return or cancel. Then I have to click on return or cancel.

    How can I fix this automatically return?
    Please let me know!

    It is not possible.

    Do you use the back button to return to a previous page?

    You receive an alert to send POST data if you return to a page or refresh a page that was requested in advance from the server by submitting form via a (hidden) MESSAGE form data.
    Firefox can only make sure to get the same page send this POST form.
    Firefox doesn't know what it means shape data, so Firefox asks for confirmation before sending the form data so action can you take to repeat an action and buy another article or post a message once.
    One way to prevent this pop-up on the removal of the POST data is not to use the back button, but to open the links on a page that is requested from a server by sending a form with the date of the POST in a new tab (window) with a middle click or hold down the CTRL key and click the link.
    Then you can close the tab or window to go back.

  • New Member has exactly * a * problem for a long time with system! ***

    first of all, I want to say hello to everyone... I just registered today... actually I just discovered today these forums exist even ;^>

    Features: 6 months ago I bought a HP Pavilion a6600f... I love it and have bought things for her from the beginning... find it me easy to use and * beep * hard to turn off ;^> I always check to make sure that I have the latest drivers for everything, cleaning the registry, etc..

    I had exactly * one * problem for the last few months and it's bugging me enough now to do something.

    System details: the bureau a6600f Pavilion has a Pentium dual core E2200 clocked at 2.2 GHz... I put 4 GB of memory in it, and it runs Vista Home Premium w/Service Pack 1 (64-bit).  the rest is probably not important to this question.

    QUESTION: when I opened the health security & in the hp Advisor, I always have yellow exclamation in a triangle "PC Update," and also a exclamation point red in a square under "PC Health".  both are caused by the same problem... the fact that I continue to say there is a new version of the "HP health check' and I need to download/install.

    problem is that I can't do.  Here is what I get.

    at first, everything seems fine.  He considers it, download it (it's about 13 MB), and I get the message 'the active support HP library configure your new installation of the software.  * That's * where the problems begin.  I get:

    «HP Active Support Library error: Error 1316.» "A network error occurred while trying to read him comes from the file C:\windows\installer\HP Library.msi of active support" (note: I checked and I don't even have this file present in C:\windows\installer... that's the problem?)

    then I get "roll back the installation.

    and finally, "error:-1603 Fatal error during installation."  Consult the help of Windows Installer (msi.chm) or MSDN for more information"

    so I can't update the HP health check and I still have these two errors (the yellow triangle and red square) present in HP CAW - PC Health & Security.

    I searched these forums and found a few issues related to the CAW of HP, and I understand that some people even turn off... but it never gave me a problem outside of it, and I want to keep around if I can.

    I'm sorry if this post is on the long side, but I wanted to provide as much information as I could.

    so, my name is Michael King and I hope to be a regular contributor here, and I don' t mind if someone wants to email me, although I understand problems of this kind are better publicly displayed where they benefit from the community as a whole.

    Thank you

    -MK

    Message edited by Michael_King on 05/16/2009 20:06

    first of all, I would like to thank the three of you who tried to help me with this problem.  This means that you, dmhoo29, anon, MrFixIt.  and as a gesture of goodwill, I would like to give Kudos to you, being a new Member and all three.

    you all had great suggestions, and based on these suggestions, I tried a few variations based on these suggestions.  Unfortunately, nothing has worked... She is always back to the same error messages, no matter what I did.

    In fact... HP * own * suggestion... which is essentially reproduced in this thread... does not work either.

    I had already spent hours on this ridiculous thing, and tonight I spent 3 hours on the subject.  I finally solved it, and the solution may benefit others who I see can easily run through a similar problem with other improvements... BECAUSE THE PROBLEM IS A RIDICULOUS OVERSIGHT ON THE PART OF HP that we can correct easily manually.

    THE SOLUTION

    What annoyed me early on, was the fact that I kept getting the message about the "HP Active Support Library.msi" file, which was looking for the installer in C:\Windows\Installer.  It seemed to me that the real problem was that he was looking for a file that simply wasn't there.

    Well, during my hours 3 screwing around with tonight, guess what I found?

    There's a right called "swsetup" subdirectory under the root of the C:\ drive.  and inside C:\swsetup, I found the following two subdirectories:

    C:\swsetup\sp36082 - and -.

    C:\swsetup\sp41377

    I knew of the many, many times I tried update HP Health Check that he was downloading sp41377. (don't remember the extension) via FTP from HP.  so I checked what was in C:\swsetup\sp41377 and guess what I found?  Well, a few things, but the only thing that concerns us is (drum roll please) THE FILE "HP ACTIVE SUPPORT LIBRARY. MSI!

    simply, I opened another window, surfed to C:\Windows\Installer and drag-and - drop "HP Active Support Library.msi" here (I pressed the 'Ctrl' key in order to make a copy of it rather than a civil rights movement).

    so now I had this annoying file in the right directory.  so, since my C:\swsetup\sp41377 window was still open, and since there is a file 'setup.exe' in there, I ran it.

    and the Holy Mother of God, it has actually worked.

    which means that what had happened was, when I tried to update the health check, that would create a subdirectory in C:\swsetup... in this case the C:\swsetup\sp41377 subdirectory... all he needed for the update here... and then ran "setup.exe" dump...

    . . except that the HP person who wrote 'setup.exe' forgot to include an itty-bitty statement in the code...

    to copy 'HP Active Support Library.msi' in the C:\Windows\Installer directory first.

    then pay attention to that sort of thing, my friends... If you try to update this HP wrote and that you get a 'cannot find file such and such in such and such directory' type of error msg, see if you can locate on your hard drive... maybe in C:\swsetup, perhaps elsewhere, I know... and if you find, just manually copy it in the required directory and run Setup again.  This might be the only time where HP committed this Sin right; ^ >... or even once, it cannot!

    Bravo and thank you again to all who have contributed.

    -Michael King

    Message edited by Michael_King on 05/17/2009 23:37
  • Manual indexing for dyn/admin CRS fails

    Hello

    I put it in place of the CRS for ATG 11.1 with short using the CIM. The short configuration CRS, has made wrong choice of configuring LDAP and SSO, which I didn't, so ask reconfigured CRS without these options.

    Now, what has happened is, when I configured the CRS for the first time, I created short request with name as 'SIR '. Because I don't want to mess with things, when I re-configured CRS second time I created new short request with name as 'CRS2' and integrated with the CRS by following the steps in the CIM. Now my set-up quite and everything works fine.

    But now, for the last step when I run the generation of indexes on the base line for the CRS of dyn/admin-> atg-> trade-> short-> index-> ProductCatalogSimpleIndexingAdmin, its failure.

    All components have managed but is the main component of indexing->/atg/commerce/short/index/EndecaScriptService coming up as "Cancelled" and in the newspaper, there is an exception. I am pasting part this exception as follows: -.

    Error Tue Feb 10 16:07:50 IST 2015 1423564670033 /atg/commerce/endeca/index/ProductCatalogSimpleIndexingAdmin---atg.repository.search.indexing.IndexingException: atg.repository.search.indexing.IndexingException: Exception when the CRS application configuration

    Error Tue Feb 10 16:07:50 IST 2015 1423564670033/atg/commerce/short/index/ProductCatalogSimpleIndexingAdmin to atg.endeca.index.AbstractRecordStoreAggregateSession.endSession(AbstractRecordStoreAggregateSession.java:509)

    Error Tue Feb 10 16:07:50 IST 2015 1423564670033/atg/commerce/short/index/ProductCatalogSimpleIndexingAdmin to atg.endeca.index.RecordSubmitterImpl.endSession(RecordSubmitterImpl.java:248)

    Error Tue Feb 10 16:07:50 / atg/commerce/short/index/ProductCatalogSimpleIndexingAdmin IST 1423564670033 from 2015 to...

    ................................................

    Error Tue Feb 10 16:07:50 IST 2015 1423564670033/atg/commerce/short/index/ProductCatalogSimpleIndexingAdmin to java.lang.Thread.run(Thread.java:744)

    Error Tue Feb 10 16:07:50 IST 2015 1423564670033/atg/commerce/short/index/ProductCatalogSimpleIndexingAdmin caused by: atg.repository.search.indexing.IndexingException: Exception when the CRS application configuration

    Error Tue Feb 10 16:07:50 IST 2015 1423564670033/atg/commerce/short/index/ProductCatalogSimpleIndexingAdmin to atg.endeca.index.ConfigImportDocumentSubmitterSessionImpl.endSession(ConfigImportDocumentSubmitterSessionImpl.java:323)

    Error Tue Feb 10 16:07:50 IST 2015 1423564670033/atg/commerce/short/index/ProductCatalogSimpleIndexingAdmin to atg.endeca.index.AbstractRecordStoreAggregateSession.commitPending(AbstractRecordStoreAggregateSession.java:545)

    Error Tue Feb 10 16:07:50 IST 2015 1423564670033/atg/commerce/short/index/ProductCatalogSimpleIndexingAdmin to atg.endeca.index.AbstractRecordStoreAggregateSession.endSession(AbstractRecordStoreAggregateSession.java:466)

    What I could see, his allusion to application short 'SRC' and not 'CRS2 '. Ideally it should be CRS2 and not the CRS.

    I checked the configuration files of short CRS from the following location and check that.

    servers\ATGPublishing\localconfig\atg\endeca\ApplicationConfiguration.properties

    servers\ATGPublishing\localconfig\atg\endeca\assembler\cartridge\manager\DefaultFileStoreFactory.properties

    in the above two files short app name is CRS2. Also, I found that there is a file generaed more short integration.

    servers\ATGPublishing\data\idxrs\ProductCatalogSimpleIndexingAdmin_DataDocumentSubmitter.SER

    which I think gets used during the indexing. There will be no problem with this file and it is one that could be a reference to the CRS application earlier.

    I have no idea to solve this problem. You can pl provide pointers/advice for this problem.

    Thank you

    Swati

    I could solve this problem as follows: -.

    1. removal of existing short applications through the following link-

    https://docs.Oracle.com/CD/E36434_01/CRS.10-1-2/ATGCRSInstall/HTML/s0306removingtheendecaapplication01.html

    2. created the new application of short for CRS, which is already configured by using the CIM. But from the point where we can set up short with the CRS application. So just tracking the application configuration delta short for Pub and Prod server part. PL the sequence - first Pub then Prod.

    For the short application configuration refer to the blog of the olive tree-

    http://IAM-saminda.blogspot.in/2013/06/Oracle-ecommerce-ATG-102.html

    3. given that I was faced with the problem of the name of the application, this time I strictly gave the application short name as - 'SIR '. Check the related application name occurs correctly at the following paths - servers\ATGPublishing\localconfig\atg\endeca\ApplicationConfiguration.properties

    servers\ATGPublishing\localconfig\atg\endeca\assembler\cartridge\manager\DefaultFileStoreFactory.properties

    Check for server prod as well.

    4 restart the servers and accessed the link to the admin of dyn pub -.

    dyn / admin-> atg-> business-> short-> index-> ProductCatalogSimpleIndexingAdmin, its failure.

    the index status was pending.

    5 Executed/clicked the button "benchmark". She completed the indexing of all the elements correctly without errors.

    6 consulted the CRS link - http://localhost:7003/src/storeus /

    My application was running.

    Thank you all for reading.

    -swati

  • You are looking for a similar effect

    I'm looking for an effect similar to that which comes after this site: http://www.nisgia.com/ is loaded. The aisles and the dispersal of elements. Any resource or tutorial for something similar?

    Here's something for you to start with. Just copy and paste on the timeline:

    
    import com.greensock.easing.Cubic;
    import com.greensock.TweenMax;
    import flash.display.Graphics;
    import flash.display.Shape;
    import flash.display.Sprite;
    import flash.events.Event;
    // array of pages
    var pages:Array;
    // number of pages
    var numPages:int = 100;
    createPages();
    
    function onEnterFrame(e:Event):void
    {
         // random to select from array
         var index:int = (pages.length - 1) * Math.random();
         //trace(index);
         var pageObj:Object = pages[index];
         var page:Sprite = pageObj.page;
         // intermadiate scale
         var interScale:Number = 1.1;
         page.x = pageObj.xs;
         page.y = pageObj.ys;
         page.scaleX = page.scaleY = 3;
         page.rotation = pageObj.rs;
         addChild(page);
         // animate the page
         TweenMax.to(page, 1, { x: pageObj.xe, y: pageObj.ye, scaleY: interScale, scaleX: interScale, ease: Cubic.easeOut, onComplete: onTweenComplete,onCompleteParams:[pageObj] } );
         pages.splice(index, 1);
         if(pages.length == 0) removeEventListener(Event.ENTER_FRAME, onEnterFrame);
              }
    /**
    * Rotates target into final position
    * @param     obj
    */
    function onTweenComplete(obj:Object):void {
         TweenMax.to(obj.page, 1, {scaleY: 1, scaleX: 1, rotation: Math.random() > .5 ? obj.rs + 10 :  obj.rs - 10} );
    }
    
    function createPages():void {
         pages = [];
         // random number
         var r:Number;
         // start positions
         var xs:Number;
         var ys:Number;
         // padding from edges
         var padding:Number = 20;
         // boundaries
         var bx:Number = stage.stageWidth - padding;
         var by:Number = stage.stageHeight - padding;
         for (var i:int = 0; i < numPages; i++)
         {
              // randomize for initial x and y
              r = Math.random();
              // position in different qarters around stage
              if (r < .25) {// top
                   xs = - 100 + Math.random() * (stage.stageWidth + 100);
                   ys = -100;
              }
              else if (r > .25 && r < .5) {// right
                   xs = stage.stageWidth + 100;
                   ys = - 100 + Math.random() * (stage.stageHeight + 100);
              }
              else if (r > .5 && r < .75) {// bottom
                   xs = - 100 + Math.random() * (stage.stageWidth + 100);
                   ys = stage.stageHeight + 100;
              }
              else {// left
                   xs = -100;
                   ys = - 100 + Math.random() * (stage.stageHeight + 100);
              }
    
              pages.push( {
                   page: page,
                   xs: xs,
                   ys: ys,
                   xe: padding + Math.random() * bx,// end x
                   ye: padding + Math.random() * by,// end y
                   rs: Math.random() > .5 ? Math.random() * 45 : Math.random() * -45// rotation start
                   } );
         }
         // start animation
         addEventListener(Event.ENTER_FRAME, onEnterFrame);
    }
    
    function get page():Sprite {
         // page dimensions
         var w:Number = 40;
         var h:Number = 52;
         // dimensions halves
         var wh:Number = w * .5;
         var hh:Number = h * .5;
         var foldWidth:Number = 10;
         var s:Sprite = new Sprite();
         var g:Graphics = s.graphics;
         g.lineStyle(1, 0xBCBCBC);
         g.beginFill(0xF0F0F0);
         g.moveTo( -wh, -hh);
         g.lineTo(wh - foldWidth, -hh);
         g.lineTo(wh, -hh + foldWidth);
         g.lineTo(wh, hh);
         g.lineTo( -wh, hh);
         g.endFill();
         g.beginFill(0xFFFFFF);
         g.moveTo(wh - foldWidth, -hh);
         g.lineTo(wh, -hh + foldWidth);
         g.lineTo(wh - foldWidth, -hh + foldWidth);
         g.lineTo(wh - foldWidth, -hh);
         g.endFill();
         s.addChild(icon);
         s.cacheAsBitmap = true;
         return s;
    }
    
    function get icon():Shape {
         var s:Shape = new Shape();
         var g:Graphics = s.graphics;
         g.beginFill(Math.random() * 0xFFFFFF);
         g.drawEllipse(-13, -20, 26, 40);
         g.endFill();
         return s;
    }
    

    Post edited by: Andrei1

  • update with order by

    Hi all

    Does anyone know if "in order to" has the priority on "updates"? In other words, by using the following query. Will be sorted first and then locked resulting lines or they will be locked everything first, and then sorted?

    SELECT / * + cardinality (para. 1) use_nl (al t) * / NULL
    LOOSE COLLECTION l_nullvalue_list
    TABLE (i_list), my_table t Al
    WHERE al.id = t.id
    ORDER BY t.id
    FOR the UPDATE OF t.id;

    Any help is appreciated.

    Kind regards
    WF

    It is the case that I do not speak:

    drop table t cascade constraints purge;
    create table t as select rownum id, cast('x' as char(100)) pad
                        from dual connect by level <= 10000;
    
    drop table t1 cascade constraints purge;
    create table t1(id int);
    
    -- 1st session
    SQL> lock table t1 in exclusive mode;
    
    Table(s) locked
    
    -- 2nd session
    declare
        type t1_type is table of rowid index by binary_integer;
        l_tab t1_type;
    begin
        execute immediate 'lock table t1 in share mode';
        select rowid bulk collect into l_tab
          from t order by dbms_random.value
           for update;
    end;
    /
    
    -- 3rd session
    declare
        type t1_type is table of rowid index by binary_integer;
        l_tab t1_type;
    begin
        execute immediate 'lock table t1 in share mode';
        select rowid bulk collect into l_tab
          from t order by dbms_random.value
           for update;
    end;
    /
    

    Now 2nd & 3rd sessions are blocked by the 1st. We will release the lock:

    -- 1st session
    SQL> commit;
    
    Commit complete
    

    2nd & 3rd sessions try to lock the rows of the table T, and fails one of the sessions with blocking:

    declare
        type t1_type is table of rowid index by binary_integer;
        l_tab t1_type;
    begin
        execute immediate 'lock table t1 in share mode';
        select rowid bulk collect into l_tab
          from t order by dbms_random.value
           for update;
    end;
    
    ORA-00060: deadlock detected while waiting for resource
    ORA-06512: at line 7
    

    If you repeat the same scenario with ORDER BY id, then a session will wait to enqueue.
    So, it's all on the order in which the row locks are acquired.

  • How it warns Oracle to use an index for the join of two tables...

    How to prevent the Oracle to use an index for the join of two tables to get a view online that is used in an update statement?

    O.K. I think I should explain what I mean:

    When you join two tables that have many entries sometimes there're better is not to use an index on the column that is used as a criterion to join.

    I have two tables: table A and table B.

    Table A has 4,000,000 entries and table B has 700,000 entries.

    I have a join of two tables with a numeric column as join criteria.

    There is an index on this column in A table.

    So I instead of
      where (A.col = B.col)
    I want to use
      where (A.col+0 = B.col)
    in order to avoid Oracle using the index.

    When I use the join in a select query, it works.

    But when I use the join as inline in an update statement I get the error ORA-01779.

    When I remove the '+ 0' the update statement works. (The column is unique in table B).

    Any ideas why this happens?

    Thank you very much in advance for any help.

    Hartmut cordially

    You plan to use a NO_INDEX hint as shown here: http://www.psoug.org/reference/hints.html

Maybe you are looking for