Partition Eliminiation on views and joins with other partitioned tables

I have a bunch of tables that are daily partioned and other which are not. We constantly join all these tables. I have noticed that partition elimination doesn't happen in most cases and I want some input or pointers on these.
Case 1
We have a view that joins a couple of partitioned tables on the id fileds and they the partition key is timestamp with local time zone.
TABLEA
tableaid
atime
TABLEB
tablebid
tableaid
btime
The view basically joins on tableaid, a.tableaid = b.tableaid(+) and a bunch of other non partitioned tables. atime and btime are the individal partition keys in the tables and these time do not match up like the id's in other words there is a little bit of correlation but they can be very different.
When I run a query against the view providing a time range for btime, I see partition elimination on tabled in the explain plan with KEY on Pstart/Pstop. But its a full tablescan on tablea. I was hoping there would be somekind of partition elimination here since its also partioned daily on the same datatype timestamp with local time zone.
Case 2
I have a couple of more partitioned tables
TABELC
tablecid
tablebid
ctime
TABLED
tabledid
tablebid
dtime
As you can see these tables are joined with tablebid and the times here generally correlate to tableb's timestamp as well.
Sub Case 1
When I join these tables to the view and give a time range on btime, I see partition elimination happening on tableb but not on tablea or any of the other tables.
Sub Case 2
Then I got rid of the view, wrote a query that us similar to the view where I join on tableaid (tablea and tableb), then on tablebid (tableb, tablec and tabled) and a few other tables and execute the query with some time range on btime and I still see that partition elimination happens only on tableb.
I thought that if other tables are also partitioned on a similark key that partition eliminition should happen? Or what am I missing here that is preventing from partition elimination on the other tables.

Performance is of utmost importance and partition pruning is going to help in that. I guess that's what I'm trying to acheive.
To achive partition elimination on tablec, d, etc I'm doing an outer join with btime and that seems to work. Also since most of the time after the partition elimination, I don't need a full tablescan since the period I will be querying most of the time will be small I also created a local index on id field that I'm using to join so that it can do a "TABLE ACCESS BY LOCAL INDEX ROWID" this way it should peform better than a global index since the index traversal path should be small when compared to the global index.
Of couse I still have problem with the tablea not being pruned, since I cannot do an outer join on two fields in the same table (id and time). So might just include the time criteria again and may be increase the time range a little more when compared to what the actual user submitted to try not to miss those rows.
Any suggestions is always welcome.

Similar Messages

  • View and join Table

    Hi,
      what is the differnce between view and join table

    Hi,
    There are 4 types of views in SAP.
    Database View - To club more than one table
    Projection View - To hide fields in one table
    Maintenance View - To maintain database records in table
    Help View - To provide help for a fields (Same functionality as Search help. This is outdated)
    View are improves performance in the following aspects
    1. If you want to use more than two table in 'JOIN' condition better to use Views . It will improves performance of a program
    2. If you want to use mutiple FOR ALL ENTRIES clause, better to club all SELECT statement in a view.
    Note:
    1.Views does not contain data in it. It fetches data from the database only depending on the condition ...
    2.Views are part of data dictionary. They are a window to view the data in database
    3.views can be used to give security to data. users can be allowed to view only basic data only
    For More Info,go thru this Threads,
    join
    Views vs Inner Join
    Regards,
    Padmam.

  • Hi, I having trouble trying to connect to the wifi, I know the passwords and checked with others divises but with the mac os x 10.7.5  mac os x lino

    Hi, I having trouble trying to connect to the wifi, I know the passwords and checked with others divises but with the mac os x 10.7.5  mac os x lion is not working
    One of the wifi connections said "time out" or did not recongnise the password

    Hi andrea122,
    Thanks for visiting Apple Support Communities.
    If you're not able to connect to Wi-Fi on your iMac, the troubleshooting steps in this article can help:
    Wi-Fi: How to troubleshoot Wi-Fi connectivity
    http://support.apple.com/kb/HT4628
    Regards,
    Jeremy

  • Key differentiation in ERP SAP Finance and Controlling with Other ERP Appli

    Hi ALL,
    I want to know one important thing in ERP SAP Application, What is the Key differentiation in SAP Finance and controlling with other ERP application like Oracle, PeopleSoft...
    And what is the main feature in SAP Finance and controlling with other ERP application.  Tell few SAP FICO features compare to other ERP application  
    thanks
    Kiran

    Hi ALL,
    I am waiting for you reply kindly cooperate in this
    thanks
    kiran

  • You should also create directories for and mount any other partitions

    Hi,
    I've downloaded archlinux-2012.12.01-dual.iso and wrote it to USB. I've booted from that USB and set up partititons using command cfdisk.
    /dev/sda5 ==> /boot
    /dev/sda6 ==> /
    /dev/sda7 ==> swap
    /dev/sda8 ==> /home
    I don't remember if I've created /mnt or if it was already there. I've created two directories: /mnt/boot and /mnt/home as per instructions:
    "https://wiki.archlinux.org/index.php/Installation_Guide
    Mount the partitions
    We now must mount the root partition on /mnt. You should also create directories for and mount any other partitions (/mnt/boot, /mnt/home, ...) if you want them to be detected by genfstab."
    I've mounted /dev/sda6 on /mnt
    and now there are no /mnt/boot and /mnt/home under the /mnt
    I don't understand what to do now because instructions state that I should create directories /mnt/boot and /mnt/home and mount them but now that I've mounted / on /mnt the /mnt/boot and /mnt/home are not available to mount partitions /dev/sda6 and /dev/sda8
    Regards

    mount /dev/sda6 /mnt
    mkdir /mnt/boot
    mount /dev/sda5 /mnt/boot
    Then do pacstrap etc. Add /home to fstab before you reboot.
    Alternatively you can mkdir /mnt/home and mount /sda8 there too, then genfstab will add the entry in fstab for it for you.
    Last edited by Mr.Elendig (2012-12-18 14:27:48)

  • Parse comma separated value and map with other table to get Name and change it back to comma separate.

    Hi,
    I have one existing view(with around 15 fields), in which I have to add few more fields from table called PI.
    Now these fields have values like (55C4444F-D83B-4F96-A011-367A3755BA6C , F52388E2-485B-49DF-8534-FDF46D23F59E , 722432E1-F063-4CBD-B83D-1B97836E82953) 3 values comma separated.(Sometimes only one value and sometimes 4 or 5 or 7-8 depend on user has entered
    on web page)
    Also I have another table called PHA and this tables has 2 fields Values and Name so I have to map this two tables based on VALUES fields and get Name from this PHA table and show in view and that also Comma separated.
    So basically I have to Parse the PI table's Values field 1st, map it with PHA table to get Name and then Make it comma separated in that existing view.
    To make fields comma separate I used below query,
    (SELECT DISTINCT SUBSTRING
                SELECT ','+ PI.[Name]  AS [text()]
                FROM [DB].[dbo].[Table] PHA1
    Inner Join  [DB].[dbo].[Table] PI
    ON PHA.[Value] = PI.[VALUE]
                WHERE PHA1.PId =PHA2.PId and PHA1.CId = PHA2.CId
                ORDER BY PHA1.PId
                For XML PATH ('')
            ), 2, 1000) 
    FROM [DB].[dbo].[Table] PHA2
    Inner Join [cSharpSite_profiles].[dbo].[PetAllergies] PA
    Inner Join  [DB].[dbo].[Table] PI
    ON PHA.[Value] = PI.[VALUE]
    ) [Name]
    Vicky

    Wait, this sounds wrong. You have a view where you group values into a comma-separated list. While that surely will make some purists cringe, I can see that it makes sense from a presentation perspective.
    But if you want to use these concatenated values as atomic values again, you should go back to the base tables and them from there. Building views on views may sometimes be a good idea, but if you are too keen on reuse you can cause a performance disaster.
    So do it right from the beginning.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Case statement resulting into Left outer join with other tables

    Hi All ,
    I am facing a stuation where a Case statement on one of the logical columns in Answers is resulting into a left outer join with a table in the query.
    If we remove the case stmt, the table is not being acessed.
    The case stmt is a simple one and no other logical column is being accessed in the case stmt.
    Please advice .
    Thanks.

    Hi Sai,
    No ..we dont have any left outer join ...its just that I am selecting measure from F1 which has a confimred dimension D1 with F2.Now when I dont have case stmt on measure from F1(Case stmt is something like : CASE WHEN "- P table"."P Column" = 'Y' THEN 'Right' ELSE 'Wrong' END), then it doesnt query F2.
    However as soon as I introduce the case stmt ,the query creates a left outer join with F2.
    Thanks.

  • I have been sharing an apple ID and icloud with other family members. How do I change my iphone so as to create my own account?

    I have been sharing I-cloud with other family members. How do I change my i-cloud setting on my i-phone so as to creare my own account?

    If you want to keep your iCloud data, you would need to migrate your device and a copy of the data to a new account.  To migrate to a new account, start by saving any photo stream photos you wish to keep to your camera roll (unless already there) by opening your my photo stream album, tapping Select, tapping the photos, tap the share icon (box with upward facing arrow), then tapping Save to Camera Roll.  If you are syncing notes with iCloud, you'll need to open each of your notes and email them to yourself so you can later copy and paste the text into new notes created in your new account.  Then go to Settings>iCloud, tap Delete Account (which only deletes it from this device, not from iCloud; others keeping the account will not be effected by this), choose Keep on My iDevice and provide the password to turn off Find My iPhone.  Then sign back in with a different Apple ID to create your new account and choose Merge to upload your data.
    Once you are on your own account, you can go to icloud.com and manually delete any data you don't want in your account without effecting anyone else.

  • How do I share address book and calendars with other iCloud users?

    I guess the title of the discussion question says it all.
    My wife, and other family members want to SHARE Contacts, Calendars etc... with other iCloud users.
    Simple task... most people would want to do it...
    But... I can't find an easy answer... how do I do it?

    Roger, thanks... I had continued my search and found this information on the discussion.
    Now, my biggest concern is the ADDRESS BOOK... I'd like to publish, specific GROUPS within my master Address Book to other iCloud users... with either Read Only, or Read Write permisions.
    Do you have any knowledge or suggestion on how that can be accomplished in iCloud?
    It seems as though this would be FOUNDATIONAL in iCloud if APPLE expects it to be a USABLE SERVICE.
    Thanks for your help...

  • Embedding tags in files for viewing and searching in other software

    Hi,
    I'm a bit confused about how tags are associated with files.  I recently transferred all my photos to a new computer and lost some, but not all, the tags I had added to my photos within Elements Organiser.  I am in the process of archiving all my old family photos by scanning slides, negatives and prints. I'm working on a Windows computer.  Most are being saved as TIFFs but I also have JPEGs and RAW files.  I want future generations of my family to be able to search these photos by using first name tags for example.  They may not have Photoshop.  My daughter uses a Mac and different software.
    I see that under the File menu there is an option 'write keyword tags and property info to photo'.  Will this save this info so that it can be found and searched in other types of software?  If so, does this apply to all types of photo files?
    And another quick similar question - when I change the date of the photo under the thumbnail in Organiser is this saved to the file?
    Thnaks for any help you can give me.
    Stuart Logan

    I think you are confusing the value and purpose of JPGs vs TIFFs vs RAWs.
    You always (that's always) save your originals. These are either the photos straight out of the camera, or straight out of the scanner. You may choose to make other versions of these photos for other purposes.
    So ... keep your originals. Keep your edited versions. When you need to send photos to somewhere else, you can make JPGs of them, and send them (after which time you could delete the JPGs if you want). If space is a problem, the generally accepted wisdom is that hard disk space is cheap, that 1 terabyte hard drive are well under 100 dollars US; so the optimal strategy is to get extra hard disk space rather than delete the originals.
    Regarding the codecs that enable you to see the RAW photo thumbnails in Windows: these will NOT allow you to see the edits you make in ACR/PSE. Nor does it help to allow you to search for keywords in DNG files. You have hit upon a disadvantage to using DNG versus RAW; if you use RAW, the tags get written to a sidecar (text) file, and these are searchable using Windows. If you use DNG, the tags are embedded into the DNG file, and are not searchable using Windows (although somewhere in the back of my mind, I thought I had heard that you can configure Windows to search for tags in DNG files, but the details, if this is true, escape me).

  • How do I delet photos from my new iPad 3 and replace with others?

    How do I delet photos from my new iPad 3 and replace them with others?  The current photos were loaded from my computer when I connected the new iPad 3 to it, but they are not the ones I want.

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • Sharing Address Book (and groups) With Others

    I know there is a way to share address book with others through mac.com, but I'm wondering if there is a way to do it without mac.com ...

    Yes, there are quite a few other options. I developed a solution for this called Address Book and Calendar Server (http://www.addressbookserver.com). There seems to be also an option to use Google etc.
    PS: I am the developer of AddressBookServer.com and naturally biased towards it.

  • I got the image on the vi,now I want to take rectangle potion from that image and compare with other image

    Hi,
    Now i have a image on VI ,i want to take rectangale postion of the image and compare with the other image(In this image also i need to take a small postionof it) and  show the result.
    Both image are equal or not....if it is equal show pass if the image is not ok fail.
    Regards,
    Sri.

    First i would like to thanks for the inputs,
    I have made one Vi for comparing the two images and display  equal or not.
    Problem:if there is a small change in the picture it is showing false ,but the image is ok only the contract ,clarity ,inclination is the problem... i need your help in controlling that image......like controlling the colors and telling if the color , shade, projection of the image of the image is in between this range show it as ok....
    i started with cluster taking the out put of the BMP file, but i am not able to do....can u help me on this.
    i am attaching the file what i have made...
    Regards,
    Sri
    Color
    Attachments:
    image.ppt ‏52 KB

  • T-sql 2008 r2 cte join with a second table

    In a sql server 2008 r2 database, I am trying to take the results of the cte called sProgram and join the results with the Person table in the query. The syntax of the join looks ok, however the results of the join are incorrect. The joined results are null
    when there is really data that can be joined. Can you tell me how to join the query so the results of the sprogram cte will be joined to the Person table correctly?
    1. Here is the query:
    ;with  sProgram as (
    SELECT   [personID],[attributeID],[value], [date],ROW_NUMBER() OVER(Partition by[personID] ORDER BY [personID],[date] DESC) rn
    FROM [dbo].[CustomS]
    where  [attributeID] in ('562','563','564','565')
    ,programSelect as
    select [personID],[attributeID],[value],[date]
    from sProgram
    where rn=1
    SELECT person.personID  
     , cs562.personID
     , cs562.attributeID
     , cs562.value
     , cs562.[date]
     , cs563.personID
     , cs563.attributeID
     , cs563.value
     , cs563.[date] 
     , cs564.personID
     , cs564.attributeID
     , cs564.value
     , cs564.[date]
     , cs565.personID
     , cs565.attributeID
     , cs565.value
     , cs565.[date]     
    FROM Person  cs562   
    join programSelect  on  cs562.personID  = Person.personID  and  cs562.attributeID= '562'
    left join programSelect cs563 on cs563.personID = cs562.personID and cs563.[Date] = cs562.[date] and cs563.attributeID ='563'
    left join programSelect  cs564 on cs564.personID = cs563.personID and  cs564.[date] = cs563.[Date] and cs564.attributeID ='564'
    left join programSelect cs565 on cs565.personID = cs564.personID and cs565.[Date] = cs564.[date] and cs565.attributeID ='565'
    GROUP BY 
    person.personID  
     , cs562.personID
     , cs562.attributeID
     , cs562.value
     , cs562.[date]
     , cs563.personID
     , cs563.attributeID
     , cs563.value
     , cs563.[date] 
     , cs564.personID
     , cs564.attributeID
     , cs564.value
     , cs564.[date]
     , cs565.personID
     , cs565.attributeID
     , cs565.value
     , cs565.[date] 
    2. here is the CustomS table with some data.
     SELECT [CustomSID]
           ,[personID]    
           ,[attributeID]
           ,[value]
           ,[date]
       FROM [dbo].[CustomS]
       where personID=7170
       and attributeID in (562,563,564,565)
       order by date desc
    CustomSID personID        attributeID      value          [date]
     262490684  7170              562          GA         2013-08-14 07:26:00
     262490683   7170              565          05/23/2014 2013-08-14 07:26:00
     262490682   7170              563           Acd         2013-08-14 07:26:00
     262490681   7170              564          08/14/2013 2013-08-14 07:26:00
     251784         7170         564          09/06/2007 2007-09-08 00:00:00
     250029         7170         562          MA         2007-09-08 00:00:00
     248287         7170         563          asp         2007-09-08 00:00:00
     251785         7170         564          09/07/2006 2006-09-08 00:00:00
     248286         7170         563          asp         2006-09-08 00:00:00
     250028         7170         562          MA         2006-09-08 00:00:00
     251783         7170         564          09/06/2006 2006-09-06 00:00:00
     249367         7170         562          LA         2006-09-06 00:00:00
     248285         7170         563          asp         2006-09-06 00:00:00
    3. Here is the table definition:
     here is the table definition:
    alter TABLE [dbo].[CustomS](
      [CustomSID] [int] IDENTITY(1,1) NOT NULL,
      [personID] [int] NOT NULL,
      [attributeID] [int] NOT NULL,
      [value] [varchar](256) NULL,
      [date] [smalldatetime] NULL,

    Partition by CustomsID will didvide data into groups based on CustomsID value.
    ROW_NUMBER will generate sequence numbers over the group and when you look for rn=1 you'll get record with latest group
    Also from what I understand you need just this instead of all those left joins
    ;with sProgram as (
    SELECT [personID],[attributeID],[value], [date],
    ROW_NUMBER() OVER(Partition by [personID],[attributeID] ORDER BY [date] DESC) rn
    FROM [dbo].[CustomS]
    where [attributeID] in ('562','563','564','565')
    SELECT p.personID
    , pr.personID , pr.attributeID , pr.value , pr.[date]
    , pr1.*
    FROM Person p
    left join sProgram pr
    on pr.personID = p.personID
    and pr.Rn = 1
    and attributeID = '562'
    outer apply (SELECT personID,
    max(case when attributeID = '563' then attributeID end) as AttrID563,
    max(case when attributeID = '563' then value end) as Value563,
    max(case when attributeID = '563' then date end) as date563,
    max(case when attributeID = '564' then attributeID end) as AttrID564,
    max(case when attributeID = '564' then value end) as Value564,
    max(case when attributeID = '564' then date end) as date564,
    max(case when attributeID = '565' then attributeID end) as AttrID565,
    max(case when attributeID = '565' then value end) as Value565,
    max(case when attributeID = '565' then date end) as date565
    where personID = p.PersonID
    and [date] = pr.[date]
    and Rn = 1
    group by personId)pr1
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Extract the data in a view and put them into a table

    Hi, all
    I am a new beginer in Oracle. Recently I have a project with 70,000 records in the database. I made a view so that I can combine the tables and extract the columns I need. However making the view took me a lot of time, thus I want to put those data into a table so that I don't have to creat the view everytime to decrease the performance. Can you help me?
    Thanks!!
    joey

    You don't need to recreate the view, you can just:
    SQL> SELECT * FROM view_name;
    However, if you want to create a table that has the same columns as the view and insert the rows from the view, you can:
    SQL> CREATE TABLE table_name AS SELECT * FROM view_name;
    null

Maybe you are looking for

  • Windows requirements for SAP ECC6 EhP7

    Hi experts, we want to install SAP ECC6 EhP7 on Windows Server (2008 or above). I've already checked on the PAM its feasability, with Kernel 7.40. The DB would be Oracle 11.2.0.4. I've found that for hardware that: 4 CPU ~2GHz each with 10 Gb Memory

  • XP will not shut down

    Just installed XP on my MacBook Pro. Installation was fine and Windows XP works fine but when I shut down XP it gets all the way to where the screen says shutting downa and then it freezes and I have to hard reset. Anyone else having that problem?

  • Adding Zeros infront of a field in Message Mapping

    Hi, I need to add zeros infront of my target field (eg Target Field length is fixed (10). If incoming field is having only 3 digits (123), I need to add 7 (10-3) zeros infront of my target field (0000000123). How to go about it. Is there any standard

  • Select All Following Of Same Track ... odd

    I don't quite understand this: I want to select all the clips to the right of cursor on a single track. But this command: Edit > Select All Of Same Track -- selects all the clips to the right of the cursor BUT ONE! Meaning, the first clip after the c

  • Missing Camera Raw Plug-in for Photoshop CC

    Camera Raw is missing from the Applications/PhotoshopCC/Plug-ins folder. When uploading images from Lightroom a message appears to the effect that CR version 8.4 is required. It advises to update through PS help menu which advises that all apps are u