Tuning OBIEE query with DB index, but it's getting slower

Hello guys
I just have a quick question about tuning the performance of sql query using bitmap indexes..
Currently, there are 2 tables, date and fact. Fact table has about 1 billion row and date dim has about 1 million. These 2 tables are joined by 2 columns:
Date.Dateid = Fact.snapshot.dates and Date.companyid = fact.companynumber
I have query that needs to be run as the following:
Select dates.dayofweek, dates,dates, fact.opened_amount from dates, facts
where Date.Dateid = Fact.snapshot.dates and Date.companyid = fact.companynumber and dates.dayofweek = 'monday'.
Currently this query is running forever. I think it is joining that takes a lot of time. I have created bitmap index on dayofweek column because it's low on distinctive rows. But it didn't seem to speed up with the performance, but rather made it worse. The explain plan before and after creating that index was the same as:
Select statement optimizer
nested loops
partition list all
index full scan RD_T.PK_FACTS_SNPSH
TABLE ACCESS BY INDEX ROWID DATES_DIM
INDEX UNIQUE SCAN DATES_DIM_DATE
It seems the bitmap index I created for DATES_DIM wasn't used... Also, I am thinking what other indexes I should create for fact table..
I'd like to know what other indexes will be helpful for me and on which table & columns?.. I am thinking of creating another one for companynumber since it also have low distinctive records.
Currently I can't purge data or create smaller table, I have to what with what I have..
So please let me know your thoughts in terms of performance tunings for such situation..
Thanks

Jack,
Thank you for your response. It helped me to clean up the query. All the changes did not give a much better explain plan - at least not to my inexperienced eyes - but the total execution time for the query is now reduced to under two minutes. The query as it is now:
select /*+ ordered all_rows */ x.rowid1
from table(sdo_join('CYCLORAMA','GEOMETRIE','CYCLORAMA','GEOMETRIE','distance=3 mask=ANYINTERACT')) x
, cyclorama s, cyclorama t
where not x.rowid1 = x.rowid2
and s.rowid = x.rowid1 and x.rowid2 = t.rowid
and s.datasetid != t.datasetid
and s.opnamedatum < t.opnamedatum;Because the docs state that mask=FILTER is the default, I added an explicit mask=ANYINTERACT to the sdo_join parameters when I removed the sdo_distance from the query. Still, the query returns 205035 records with the sdo_distance, and 205125 without. But this may be the result of the extra 0.001 from sdo_dim. I did not investigate as the 3 meter is not crucial.
I believe I already had a mechanism in place to reduce the number of self-joins with "not x.rowid1 = x.rowid2" and "s.opnamedatum < t.opnamedatum". I can not guarantee that for all records s.opnamedatum < t.opnamedatum equals x.rowid1 < x.rowid2.
Based on the [url http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14255/sdo_operat.htm#BGEDJIBF]docs, I finally added an 'ordered' hint and reshuffled the tables in the from clause.
I'm happy with performance now, and creating a new table with the records to keep should not be a problem. Still I'm curious about the following:
<li>Is it worth optimizing the SDO_DIM_ARRAY for the original table, e.g. narrowing the range of coordinate values?
<li>How can sdo_join best be used for an anti-join, to select the records to keep?
Thank you,
J-----.

Similar Messages

  • I am trying to sync my itunes with my ipod, but when I get to step 3 of syncing, it stops. Also, I deleted all the songs on my ipod, and when I go to my music in my ipod the songs are all still there and in a grey color and I'm not able to select them.

    I am trying to sync my itunes with my ipod, but when I get to step 3 of syncing, it stops. Also, I deleted all the songs on my ipod, and when I go to my music in my ipod the songs are all still there and in a grey color and I'm not able to select them. How do I completely clear my ipod music, and how can I solve the syncing problem?

    Sync works the same way it always has, connect the device, select the content desired to sync and sync.
    All the media should be in iTunes already, iDevices are not and have never been backup devices.
    If this is a new computer, move the content from the old computer to the new computer.

  • I'm trying to backup a my harddrive with disk utility but I'm getting an error  Unable to create Backup.dmg" (input/output error). Is there any other way to save my data? I believe my hard drive is failing or corrupt file. I can't boot up. Grey screen

    I'm trying to backup a my hard drive with disk utility but I'm getting an error  Unable to create Backup.dmg" (input/output error). Is there any other way to save my data? I believe my hard drive is failing or corrupt file. I can't boot up. Grey screen and spinning wheel. I've tried everything https://discussions.apple.com/message/20580424#20580424
    any help will be greatly appreciated.

    Check here. Also have you done a TimeMachine back up?
    http://support.apple.com/kb/TS2570

  • How do I fix the compatibility issue between my iPhone 4S with iOS 7 and my Pioneer car stereo? There was no problem with iOS 6, but now I get a message saying "this device is not compatible" and so I can't use Netflix for example. How do I fix it?

    How do I fix the compatibility issue between my iPhone 4S with iOS 7 and my Pioneer car stereo? There was no problem with iOS 6, but now I get a message saying "this device is not compatible" and so I can't use Netflix for example. How do I fix it?

    This is a typical response from the manufacturer. Did you try the fix that Lawrence mentioned. When Apple or any other phone manufacturer update phone software, they have the latest Bluetooth installed. It is usually the problem with the radio manufacturer that they devices are using the older Bluetooth protocols. You can try this support document http://support.apple.com/kb/TS3581 and see if anything there helps, but generally it requires the radio manufacturer to update their firmware.

  • TS3510 I only have one apple ID and facetime has worked with it before, but now I get the message "Unable to verify email because it is already in use". I have looked ofr a solution but can't find one. can anyone help please?

    I only have one apple ID and facetime has worked with it before, but now I get the message "Unable to verify email because it is already in use". I have looked ofr a solution but can't find one. can anyone help please?

    I spoke with Apple Support this morning and they believe anything MobileMe related is due to the conversion over to iCloud that's taking place.
    As for other email clients, check with your host to see if settings have changed on their end. I use inmotionhosting.com and over the weekend the updated their outgoing requirements so that a password authentication is now needed.
    Hope that helps get some on the right path to resolving their issues!

  • HT1386 I sync all songs, photos and videos between my computer and iPod classic with no problems, but when I get to sync info I get this message: "iTunes cannot sync Calendar and contacts to iPod. Try logging out of Windows adn then logging back in".

    I sync all songs, photos and videos between my computer and iPod classic with no problems, but when I get to sync info I get this message: "iTunes cannot sync Calendar and contacts to iPod. Try logging out of Windows adn then logging back in".  Could you please help?

    Correct. When you update via iTunes all synced media that is not in your iTunes library will be lost.
    As IO said before:
    You can redownload most iTunes pruchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    I do not think it included audio books.

  • Hello my name is leandro from months ago and am trying to connect with my apple id but informs me that it is wrong and I can not buy or upgrade my mac from the official website of apple can go with my ide but can not get response technical support'm from

    hello my name is leandro from months ago and am trying to connect with my apple id but informs me that it is wrong and I can not buy or upgrade my mac from the official website of apple can go with my ide but can not get response technical support'm from Argentina someone could help me

    Apple ID security issues -
    Call Apple Care and ask for the Account Security Team. They can assist you with your issue.

  • I have a old firefox account and I cannot sign on too. I made new account just to ask a question. I tried to sign in with old emails, but did not get any reset information back. How can I recover old information?

    I have a old firefox account and I cannot sign on too. I made new account just to ask a question. I tried to sign in with old emails, but did not get any reset information back. How can I recover old information?

    Backing up and restoring your Profile should have included your bookmarks.
    https://support.mozilla.org/en-US/kb/back-and-restore-information-firefox-profiles
    https://support.mozilla.org/en-US/kb/recovering-important-data-from-an-old-profile
    That looks like a JSON bookmarks backup file, from 11-01-2012. Did you try '''restoring''' that file?
    https://support.mozilla.org/en-US/kb/restore-bookmarks-from-backup-or-move-them#w_using-a-bookmark-backup-file
    Never messed with JSON files other than viewing them on a few occasions out of curiosity. There are no line breaks which make them very difficult to read.
    As far as working with that file in {like} NotePad goes:
    A. use Find / Search for each indecent of a '''"uri"''' string, then "copy and paste" the uri into another text file, and then move on to the next "uri" string.
    B. use a text program where a filter can be set for the "uri" field in the JSON file for a line break or to "scrape out" the "uri"s only for display or export to a list of uri's.
    Or try using an online JSON editor like this, to try to display only the "uri" field.
    https://www.jsoneditoronline.org/

  • I have recently bought macbookpro but it is getting slow down. How to fix this issue

    I have recently bought macbookpro but it is getting slow down. How to fix this issue

    Too vague a question.
    What is slow... the bootup... or something else?
    Start with repairing disk permissions.

  • I got macbook pro 13" i bought in 2011 but its now getting slow when i start up or when shutting down .and apps takes time to open like just bouncing????????

    i got macbook pro 13" i bought in 2011 but its now getting slow when i start up or when shutting down .and apps takes time to open like just bouncing????????

    See the Mac OS X Speed FAQ.

  • Iphone 4s with ios 8.1.1, imessage gets slower than ever, sometimes even deliver after 10 min, was not like this with the previous ios, how can I improve imessage sending time?

    iphone 4s with ios 8.1.1, imessage gets slower than ever, sometimes even deliver after 10 min, was not like this with the previous ios, how can I improve imessage sending time?

    Hi there skmonirul,
    Welcome to Apple Support Communities.
    From what I gather, iMessages are taking longer than expected to send on your iPhone 4s. If you aren’t seeing issues with other apps, try restarting your iPhone as shown here: 
    Restart or reset your iPhone, iPad, or iPod touch - Apple Support
    If the issue persists, try restoring your iPhone as shown in the article below.
    Use iTunes to restore your iOS device to factory settings - Apple Support
    So long,
    -Jason

  • Peformance tuning of query using bitmap indexes

    Hello guys
    I just have a quick question about tuning the performance of sql query using bitmap indexes..
    Currently, there are 2 tables, date and fact. Fact table has about 1 billion row and date dim has about 1 million. These 2 tables are joined by 2 columns:
    Date.Dateid = Fact.snapshot.dates and Date.companyid = fact.companynumber
    I have query that needs to be run as the following:
    Select dates.dayofweek, dates,dates, fact.opened_amount from dates, facts
    where Date.Dateid = Fact.snapshot.dates and Date.companyid = fact.companynumber and dates.dayofweek = 'monday'.
    Currently this query is running forever. I think it is joining that takes a lot of time. I have created bitmap index on dayofweek column because it's low on distinctive rows. But it didn't seem to speed up with the performance..
    I'd like to know what other indexes will be helpful for me.. I am thinking of creating another one for companynumber since it also have low distinctive records.
    Currently the query is being generated by frontend tools like OBIEE so I can't change the sql nor can't I purge data or create smaller table, I have to what with what I have..
    So please let me know your thoughts in terms of performance tunings.
    Thanks

    The explain plan is:
    Row cost Bytes
    Select statement optimizer 1 1
    nested loops 1 1 299
    partition list all 1 0 266
    index full scan RD_T.PK_FACTS_SNPSH 1 0 266
    TABLE ACCESS BY INDEX ROWID DATES_DIM 1 1 33
    INDEX UNIQUE SCAN DATES_DIM_DATE 1 1
    There is no changes nor wait states, but query is taking 18 mins to return results. When it does, it returns 1 billion rows, which is the same number of rows of the fact table....(strange?)That's not a bitmap plan. Plans using bitmaps should have steps indicating bitmap conversions; this plan is listing ordinary btree index access. The rows and bytes on the plan for the volume of data you suggested have to be incorrect. (1 row instead of 1B?????)
    What version of the data base are you using?
    What is your partition key?
    Are the partioned table indexes global or local? Is the partition key part of the join columns, and is it indexed?
    Analyze the tables and all indexes (use dbms_stats) and see if the statistics get better. If that doesn't work try the dynamic sampling hint (there is some overhead for this) to get statistics at runtime.
    I have seen stats like the ones you listed appear in 10g myself.
    Edited by: riedelme on Oct 30, 2009 10:37 AM

  • Tuning SQL query with SDO and Contains?

    I'trying to optimize a query
    with a sdo_filter and an intermedia_contains
    on a 3.000.000 records table,
    the query look like this
    SELECT COUNT(*) FROM professionnel WHERE mdsys.sdo_filter(professionnel.coor_cart,mdsys.sdo_geometry(2003, null, null,mdsys.sdo_elem_info_array(1,1003,4),mdsys.sdo_ordinate_array(809990,2087279,778784,2087279,794387,2102882)),'querytype=window') = 'TRUE' AND professionnel.code_rubr ='12 3 30' AND CONTAINS(professionnel.Ctx,'PLOMBERIE within Nom and ( RUE within Adresse1 )',1)>0
    and it takes 15s on a bi 750 pentium III with
    1.5Go of memory running under 8.1.6 linux.
    What can i do to improve this query time?
    null

    Hi Vincent,
    We have patches for Oracle 8.1.6 Spatial
    on NT and Solaris.
    These patches include bug fixes and
    performance enhancements.
    We are in the process of making these patches
    avaialble in a permanent place, but until then, I will temporarily put the patches on:
    ftp://oracle-ftp.oracle.com/
    Log in as anonymous and use your email for
    password.
    The patches are in /tmp/outgoing in:
    NT816-000706.zip - NT patch
    libordsdo.tar - Solaris patch
    I recommend doing some analysis on
    individual pieces of the query.
    i.e. time the following:
    1)
    SELECT COUNT(*)
    FROM professionnel
    WHERE mdsys.sdo_filter(
    professionnel.coor_cart,
    mdsys.sdo_geometry(
    2003, null, null,
    mdsys.sdo_elem_info_array(1,1003,4),
    mdsys.sdo_ordinate_array(
    809990,2087279,
    778784,2087279,
    794387,2102882)),
    'querytype=window') = 'TRUE';
    2)
    SELECT COUNT(*)
    FROM professionnel
    WHERE CONTAINS(professionnel.Ctx,
    'PLOMBERIE within Nom and ( RUE within Adresse1)',1) >0;
    You might want to try reorganizing the entire
    query as follows (no promises).
    If you contact me directly, I can try to
    help to further tune the SQL.
    Hope this helps. Thanks.
    Dan
    select count(*)
    FROM
    (SELECT /*+ no_merge */ rowid
    FROM professionnel
    WHERE mdsys.sdo_filter(
    professionnel.coor_cart,
    mdsys.sdo_geometry(
    2003, null, null,
    mdsys.sdo_elem_info_array(1,1003,4),
    mdsys.sdo_ordinate_array(809990,2087279,
    778784,2087279,
    794387,2102882)),
    'querytype=window') = 'TRUE'
    ) a,
    (SELECT /*+ no_merge */ rowid
    FROM professionnel
    WHERE CONTAINS(professionnel.Ctx,
    'PLOMBERIE within Nom and
    ( RUE within Adresse1)',1) >0
    ) b
    where a.rowid = b.rowid
    and professionnel.code_rubr ='12 3 30';
    **NOTE** Try this with no index on code_rubr
    null

  • BI Query with Hierarchy in VC does not get correct values

    Hello Gurus,
    I am building a model in VC for Performance Score card using Query as data service.
    I have  the following problem.
    When I execute query in BEx with Hierachy_node variable , it is getting correct values, but the same is getting incorrect values in VC.
    The Hierarcynode variable I am using is a TOP node, then the values including child nodes are also should be displayed, which is working fine with BEx query but not in VC.
    When I execute the query with hierarchy node value as child node I am getting correct values both in VC and in BEx.
    The correct values are not shown only when I use top nodes.
    Please help me in this regard.
    Thanks in advance
    Ganesh

    Hi
    We are facing the same issue. Is this issue resolved? Pls let us know the solution
    Regards
    Aruna

  • I can only see the welcome to mail screen (iphone 5).  I have set up mail successfully because it shows mail icon with messages.  But I cant get into the mail box!

    I can only see the welcome to mail screen (iphone 5).  I have successfully set up the mail because it shows mail icon with messages (104 messages).  But I cant get into the actual mail box to read them.  Pls help!

    The received emails should show in two locations:
    1. In the All Inboxes tab of Mail.
    2. The Inbox for each mail account,
    If your emails are not showing in these locations try quitting the mail app and then reset your iPhone.
    Go to the Home screen and double click the Home button. That will reveal the row of recently used apps at the bottom of the screen. Tap and hold on the app in question until it wiggles and displays a minus sign. Tap the minus sign to actually quit the app. Then tap anywhere on the screen above that bottom row to return the screen to normal.
    To reset your device. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider should one appear until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

Maybe you are looking for