What index types do you suggest when you have...

If you have tables A, B, C and they are all partitioned range by created_date where that is a timestamp
If nearly all queries can only specify created_date on C only because the B's that belong to A and the C's that belong to B can all be in different partitions relative to their children. So if you have weekly partitions for A, B, C the C's the belong to B and the B's the belong to A can be in different weeks partitions. Now A, B and C all use surrogate keys and there's an index on all of them. You have one to many b/w A->B and one to many b/w B->C where any C has a 1 B parent and that B parent can have one and only one A parent.
When doing the join you end up doing something like
select * from A, B, C
where A.a_id = B.a_id
and B.b_id = C.b_id
and C.created_date >sysdate - 1
The problem is that the indexes on A and B are all global non partitioned as are the indexes on C
Right now we get partition elimination on C on a good day but when the optimizer decides go to A first we get none. Whenever the optimizer goes to A it often does partition range all scans because there is no partition key on A or B
used in the query.
How can we get the query plan to reliably use C first so that partition elimination is always guaranteed.
Currently our thinking is to use /*+ ORDERED */ where the from is C, B, A
Unfortunately the programs cannot introduce bind variables so where we can use Baselines to manage the plan for a given sql_id the only way we can do this is to use CURSOR_SHARING=force via login trigger on their session. This forces the
introduction of bind variables in to the query but Their queries are formed dynamically from a GUI screen that optionally can provide different parameters. So not only do you have N's items in an IN clause to worry about you also have other optional parameters that can show up in the query depending on whether they are used or not.
Q. Has anybody solved this problem by wrapping the query in a procedure so that you can pin the plan to the procedure where all that differs in the procedure is how the arguments are specified? This seems tedius to me because the procedure would have to take comma separate lists of values whenever you want to pass the values to be used in an IN clause.
Only if you wrap a query that can have optional parameters and N values for any parameter can you manage the plan for that procedure thru a baseline otherwise you simply end up with too many plans to manage because of the different combinations of the size of the IN clauses and the optional parameters that can be specified.
When joining b/w A, B, C etc what indexes should be partitioned?
The typical query uses column values on A to limit the C's associated with the B's that are associated with the A's that match those columns. Those fields on A have global indexes so often when the plan is one where it starts at A first and works it's way down it has to consider far too many rows from A that are unrelated to the eventual partition narrowed to from the C.created_date predicate.
Edited by: steffi on Mar 8, 2011 8:56 PM
Edited by: steffi on Mar 8, 2011 8:57 PM
Edited by: steffi on Mar 8, 2011 8:58 PM

Dear Steffi,
The problem is that the indexes on A and B are all global non partitioned as are the indexes on CWhy are you saying that this is a problem?
What are the definition of your primary index on A, B, and C?
You can eventually add the partition key (created_date) to those primary keys and hence locally partition their corresponding PK indexes
As far as you wrote that there is no relation ship between A.created_date, B.created_date a and C.created_date, then I beleive you can't benefit from the partition wise join because in such case you need to join A,B and C on the same partition key which is created_date
Currently our thinking is to use /*+ ORDERED */ where the from is C, B, AUsing /*+ ORDERED */ is not a guarantee that the Oracle Optimiser will obey this hint.
Use the hint /*+ Leading(C) */ instaedYou know that when you wrap your query into a static PL/SQL procedure you don't have to care then about the use bind variable. It will be used;
that is how static PL/SQL wroks. But when you are using dynamic sql into this PL/SQL procedure you need in this case to take care about using bind variable.
The auto-binding trick which is represented by the cursor_sharing=force (or similar) is not highly recommended as far as there exist side effects like the one that cames to my mind now which is when you have function based indexes based on litteral (for example a function based index like substr(a,2,4)) will be rewritten, when cursor_sharing is set to force, to be substr(a, :SYS_B0, :SYS_B1) which will not mach your original query and will not use the function based index anymore
Best Regards
Mohamed Houri

Similar Messages

  • What is the longest you have waited before find my ipod has located it on the map?

    What is the longest you have waited before the find my ipod has located it on the map?

    Welcome to the Apple Community.
    Generally it's less than a minute, however when the device can't be located (maybe its on a train in a tunnel, or it's turned off), it can be any length of time.

  • What to do if you have an i phone5 threw sprint carrier and arent able  to creat events on ur calendar app

    What to do if you have an i phone5 threw sprint carrier and arent able  to creat events on ur calendar app

    What carrier you are on should not be an issue when it comes to operating an app. What happens when you try and create an event? Do you see an error, does the calendar app do something when you try to add an event?
    What user troubleshooting have you tried. From the User Guide http://support.apple.com/kb/HT1296, the steps are restart (power off/on), reset (hold the sleep/wake and home buttons together until you see the Apple logo and then release. The phone will restart), a restore from a backup, and lastly a restore as a new phone.

  • How can you tell what version of Quicktime you have?

    How do you determine what version of Quicktime you have on your computer? What version do you need for a new 30G Video iPod? How do you upgrade versions, if necessary?
    Thanks in advance for any help.
    iPod mini for windows   Windows XP  

    Open a QT document and use the Help menu, where you should see an item labeled (I believe) About Quicktime Player. That should tell you the version running the player.
    You need QT Pro and QT 7 to have a preset for iPod video. You probably can use QT 6 if you use these settings in making an mpeg-4 video:
    "MPEG-4 video: up to 2.5 mbps, 480x480, 30 frames per sec., Simple Profile with AAC-LC up to 160 Kbps, 48 Khz, stereo audio in .m4v, .mp4 and .mov file formats<<
    QT 7 is available for download from the Apple site by clicking on
    "Quicktime" in the Purple banner above

  • How can you tell what generation apple tv you have?

    How can you tell what generation apple tv you have?

    Apple TV 1. gen: http://www.apple.com/de/support/appletv/1st_generation/
    Apple TV 2. gen: http://www.apple.com/de/support/appletv/

  • Knowing What Generation I POD you have

    How do you know what generation IPOD Nano you have ? is their some way to look it up on the Ipod ?

    http://support.apple.com/kb/HT1353

  • What are the documentations you have done.

    Hi,
         What are the documentation you have done in SD module, This is the Question which I had faced in the Interview, Did any one explain me meaning of documentation with Examples.
    Regards,
    Arjun.

    Hallo sir,
                  could you please expalain me the SD relavant documentations with some examples.
    Arjun.

  • The last few days I have been constantly saving my file. About an hour ago I opened my file and the most recent work wasn't saved even though I'm sure I saved it before closing. What can I do? Also, when I have tried to email it to myself as a backup, the

    The last few days I have been constantly saving my file. A couple of hours ago I renamed the file and then reopened my file a little while later, but the most recent work wasn't saved even though I'm sure I saved it before closing. What can I do? Also, when I have tried to email it to myself as a backup, the fields aren't populated when I open it up. Fyi, I have the free subscription.

    Hi Constance,
    As i understand your changes in the pdf were not saved...Are you still facing this issue?
    Regards,
    Rahul

  • What to do if you have backlight bleed through

      Despite my recent negative posts about Apple and the iPad 2 I take all of it back, because I have just found the incerdible cure for the dreaded
    "Backlight bleedthrough"  here's what to do
    First go to your device settings and open up the brightness tab
    Next drag your finger across the scroll bar untill you reach about the 25% mark (in the middle of the middle and the lowest you can go)
    Then make sure Auto-Brightness is turned off
    Lastly go to a drak room and do a hard-reset Hint:(hold the power button and the home button untill your device opens a page with just an Apple logo and a Black screen) after you have entered the hard-reset examine your device for any backlight bleedthrough and if you find any just power your device back on and repeat all steps Hint:( lower the screen brightness all the way to 0% the lowest you can go).
    Thanks so much for reading my easy fix for the dreaded "Backlight-bleedthrough"
    If the issue still continues consult your nearest Apple store imediately or call 1-800-MY-APPLE or 1-800-APL-CARE.

    What carrier you are on should not be an issue when it comes to operating an app. What happens when you try and create an event? Do you see an error, does the calendar app do something when you try to add an event?
    What user troubleshooting have you tried. From the User Guide http://support.apple.com/kb/HT1296, the steps are restart (power off/on), reset (hold the sleep/wake and home buttons together until you see the Apple logo and then release. The phone will restart), a restore from a backup, and lastly a restore as a new phone.

  • Immediately see what versions of sites you have created upon opening your site in Muse

    When you open one of your sites in Muse, you go right to the planning screen.  My screen defaults to the DESKTOP view.  I would love a way that we could see a quick section...maybe split the main screen into thirds from top to bottom where you can see a quick view of your DESKTOP version, your TABLET version and your PHONE version if you have all three created.
    I thought of this just now because there was an important link on my client's website that needed changed.  I made the change, and then minutes later, I remembered that I had recently also done a TABLET version for my client too and I had completely forgotten about it.  So I went back in to Muse, clicked on the TABLET tab and changed the link there as well. 
    As it is now, the only way I can tell that I have done a different version is because the plus mark is gone before the word on the tab.  Even changing the color of the tabs for the versions you HAVE created would maybe help jog someone's memory not to forget to update the other version as well.

    Or, how about this:
    Does anyone know how to have Edge Animate objects that utilize "_top" in an open url trigger make the Muse site that they are a part of open a new window/tab with that action (as opposed to having it open the url in the current page, or using "_blank" in the trigger)?

  • Please fix this problem. "Enter" on our Keyboards means to go to the next line of type. You have enter as a termintor and a normal typist has to try a few times to get used to your site.

    I have a Dell Inspiron with Win-7. I had FF on it but too many conflicts developed so I deleted FF.
    Only I miss FF a LOT! And I want to use it again.
    Can you help me out? Will FF run on Win-7?
    And what do I have to do to make it happen.
    I have a Laptop too. I'll be going to it after we get the Wireless Router working.

    Your title line is certainly not a true statement. It is certainly also used for "Enter", it depends on what you are doing. It also is used for entering the highlighted choice in a dialog window and is part of the reason why my middle mouse button is set to "Enter". Old keyboards used to have two separate keys, one for new line, and one for Enter.
    Perhaps if you explained where it is giving you a problem we could provide a more reasoned answer -- may not be what want, but there is probably logic behind what you get.
    Of course Firefox can run on Windows 7, it would not be popular if it couldn't.
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it.</small>
    * Windows 7 Home Premium<br>http://dmcritchie.mvps.org/windows-7/win7.htm
    * Firefox Problems &amp; Issues (Notes)<br>http://dmcritchie.mvps.org/firefox/firefox-problems.htm
    * Firefox and other Browser Keyboard Shortcuts (Comparison Table)<br>http://dmcritchie.mvps.org/firefox/keyboard.htm
    You can make '''Firefox 6.0''' look like Firefox 3.6.*, see numbered '''items 1-10''' in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 thru 6.0, look like 3.6)]. ''Whether or not you make changes, you should be aware of what has changed and what you have to do to use changed or missing features.''
    * http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface
    There is a lot more beyond those first 10 steps listed, if you want to make Firefox more functional.

  • What to do if you have deleted your App Store

    What do you door you have deleted you App Store on accident

    It's a built-in app so it can't be deleted, though it might be hidden. If you can't find it on any of your homescreens or app folders, and you can't find it via the spotlight search screen (pull down the centre of the home screen down in iOS 7, swipe your first home screen to the right in iOS 6 and below), then is it hidden by Settings > General > Restrictions > Installing Apps being set 'off' ?
    If not then have you tried a reset to see if you can find it after the iPad has restarted ? Press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • How do you know what version of iTunes you have?

    I need to know! How do I find this out?

    Look for the HELP tab when you have iTunes running. Click on help then scroll down to "About iTunes"
    Your Version number will pop up and driver versions will scroll bottoms up.
    If you don't have version 6, back up your music/iTunes and go for it. I went from 4.7 to 6.0 last night. Other posters have said to turn off Norton and firewalls to avoid problems.
    Mike

  • What does the message "You have exceeded your license" mean? I cannot open aperture on my computer

    I installed aperture on my lap top. I now tried to install it on my Mac Pro. I got a message saying I have exceeded my license, but it let me install anyway. Now there is a grey circle with a line thru the app icon and I cannot open. Can someone help me?

    We have the boxed version
    The licence for the boxed version allows two installations, one on a Desktop Mac and one on a portable Mac.
    But when you install the boxed retail version on a Mavericks system and update it to Aperture 3.5.1, your licence for the retail version will be converted to a licence from the App Store and tied to your Apple ID. After that, your retail version registration key is no longer valid.
    You have to download Aperture from the App Store and use the AppleID, you used when you updated Aperture to 3.5.1.
    Do you have updated Aperture to 3.5.1 on one of your Macs?  Then delete the crossed-our Aperture on your MacPro and launch the AppStore. Sign in with the same AppleID you used on your laptop. Open the "Purchased" tab and look for Aperture. Is it there and is the "Install" button available?

  • Web page video - what file type would you recommend?

    I've stood up a web page for selling things (house, musical instrument, chipper-shredder, rent an apartment, etc.) and would like to have a few videos included. The plan is to save the video on the server and not use hyperlinks to places like vimeo and youtube. For one thing, vimeo doesn't allow a basic member to use their site for selling things.
    A. Screen view size: I would like something, say, 2.5 to 3 inches high X whatever width the proportion would be (4:5 or 16:9), minimum.
    B. Resolution: Most of what I've recorded is in 1440CBR but reducing the quality to keep the file size small is VERY important. I'm not looking for Full Hi-Def, just something that gets the message across.
    C. It is very desirable for the visitor to be able to start viewing the video as soon after clicking on the hyperlink as possible. If they have to wait for a few MegaBytes to be downloaded they probably won't stick around. Also, there will be no advertising on my web page which should be nice.
    D. The file format should be viewable by both Macs and PCs. Questions:
    1. Is *.mp4 H.264 the most universal format?
    2. Should I "Share" to a QuickTime format and assume the PC users will have QuickTime on their machine?
    3. FCPx uses the "Share" menu in order to Export. What would you recommend for a Share setting (file type) so it will do what I would like to do?
    Is there anything I left out that would be good to know???
    Editorial comment: This has been a total struggle.
    My resources:
    FCPX 10.0.3 (have not updated yet. Waiting until the dust settles)
    MacBook Pro Core 2 Duo 5,1 2.53 8GB memory Lion
    MacPro 1,1 Lion
    Passport drive: 1TB for video storage
    MacBook White 1,1 (for email and Internet surfing) 10.6.8

    Hi again,
    I'm happy with the Audioengine 5 which I have on the computer desk about 2' ~ 3'
    away so I'd call them 'near field'. You should have a shelf on your desk so the speakers are roughly at your head height.  I'm also using a 12" Velodyne powered sub in this set-up which sits on the floor to my right.
    here are some 'home' studio designs:
    http://www.youtube.com/watch?v=OQ9oAhm8GsE&feature=related
    http://www.youtube.com/watch?v=PdCQBs5wsyc&feature=related
    http://www.youtube.com/watch?v=PKk1N6moZPc&feature=related
    http://www.youtube.com/watch?v=X4Smei451dw&feature=related

Maybe you are looking for