Doubt with index hint

I have a doubt with applying the index hint to fire for multiple coulmns in a query.
For a single column, it is ok like:-
select /*+ index( ppbS_inv_sim_serial iss_status) */ item_type_id, status, city from
ppbS_inv_sim_serial where status='IT';
there is a problem with indexes firing in our database so this way, using hint, the
indexes fire.
But, what, if i want all 3 indexes in the query to fire like
select count(1) from
ppbS_inv_sim_serial where status='IT' and item_type_id='A2' and city='USA';
I hope, my question is clear. Please, help i solving my doubt as it is urgent.
regards.

Fix the problem. Not the symptom.
Using hints in SQL, especially production SQL, is a very poor way to address the problem and only fix the symptom for a period. Until the problem rears its head again and bite you in the butt - a lot more painful this time around.
Solving performance problems start with Rule #1.
RULE 1#. IDENTIFY THE PERFORMANCE PROBLEM
Saying that something is slow, is not identifying the problem. The only way a problem can be solved is if you have at least some idea what the actual problem is.
Identifying the problem will point to issues like:
- database schema(s) not being analysed or analysed correctly
- poorly designed and written SQL (often the case)
- poorly configured Oracle instance
- problem/bug(?) with the Oracle CBO
And depending on the problem analysis, the problem can be CORRECTLY and COMPREHENSIVELY and PROPERLY addressed.
Fixing symptoms? That is only moving the brick wall a bit further away. Allowing you to run even faster into it the next time around.

Similar Messages

  • SQL query performance difference with Index Hint in Oracle 10g

    Hi,
    I was having a problem in SQL select query which was taking around 20 seconds to get the results. So, by hit and trail method I added Index Oracle Hint into the same query with the list of indexes of the tables and the results are retrieved with in 10 milli seconds. I am not sure to get How this is working with Indexes Hint.
    The query with out Index Hint:
    select /*+rule*/ FdnTab2.fdn, paramTab3.attr_name from fdnmappingtable FdnTab, fdnmappingtable FdnTab2, parametertable paramTab1 ,parametertable paramTab3  where FdnTab.id=52787 and paramTab1.id= FdnTab.id  and paramTab3.id = FdnTab.id  and paramTab3.attr_value = FdnTab2.fdn  and paramTab1.attr_name='harqUsersMax' and paramTab1.attr_value <> 'DEFAULT' and exists ( select ParamTab2.attr_name from parametertable ParamTab2, templaterelationtable TemplateTab2  where TemplateTab2.id=FdnTab.id  and ParamTab2.id=TemplateTab2.template_id  and ParamTab2.id=FdnTab2.id  and ParamTab2.attr_name=paramTab1.attr_name)  ==> EXECUTION TIME: 20 secs
    The same query with Index Hint:
    select /*+INDEX(fdnmappingtable[PRIMARY_KY_FDNMAPPINGTABLE],parametertable[PRIMARY_KY_PARAMETERTABLE])*/ FdnTab2.fdn, paramTab3.attr_name from fdnmappingtable FdnTab, fdnmappingtable FdnTab2, parametertable paramTab1 ,parametertable paramTab3 where FdnTab.id=52787 and paramTab1.id= FdnTab.id and paramTab3.id = FdnTab.id and paramTab3.attr_value = FdnTab2.fdn and paramTab1.attr_name='harqUsersMax' and paramTab1.attr_value <> 'DEFAULT' and exists ( select ParamTab2.attr_name from parametertable ParamTab2, templaterelationtable TemplateTab2 where TemplateTab2.id=FdnTab.id and ParamTab2.id=TemplateTab2.template_id and ParamTab2.id=FdnTab2.id and ParamTab2.attr_name=paramTab1.attr_name) ==> EXECUTION TIME: 10 milli secs
    Can any one suggest what could be the real problem?
    Regards,
    Purushotham

    Sorry,
    The right query and the explain plan:
    select /*+rule*/ FdnTab2.fdn, paramTab3.attr_name from fdnmappingtable FdnTab, fdnmappingtable FdnTab2, parametertable paramTab1 ,parametertable paramTab3  where FdnTab.id=52787 and paramTab1.id= FdnTab.id  and paramTab3.id = FdnTab.id  and paramTab3.attr_value = FdnTab2.fdn  and paramTab1.attr_name='harqUsersMax' and paramTab1.attr_value <> 'DEFAULT' and exists ( select ParamTab2.attr_name from parametertable ParamTab2, templaterelationtable TemplateTab2  where TemplateTab2.id=FdnTab.id  and ParamTab2.id=TemplateTab2.template_id  and ParamTab2.id=FdnTab2.id  and ParamTab2.attr_name=paramTab1.attr_name) 
    SQL> @$ORACLE_HOME/rdbms/admin/utlxpls.sql
    PLAN_TABLE_OUTPUT
    Plan hash value: 651267974
    | Id | Operation | Name |
    | 0 | SELECT STATEMENT | |
    |* 1 | FILTER | |
    | 2 | NESTED LOOPS | |
    | 3 | NESTED LOOPS | |
    | 4 | NESTED LOOPS | |
    |* 5 | INDEX UNIQUE SCAN | PRIMARY_KY_FDNMAPPINGTABLE |
    PLAN_TABLE_OUTPUT
    |* 6 | TABLE ACCESS BY INDEX ROWID| PARAMETERTABLE |
    |* 7 | INDEX UNIQUE SCAN | PRIMARY_KY_PARAMETERTABLE |
    | 8 | TABLE ACCESS BY INDEX ROWID | PARAMETERTABLE |
    |* 9 | INDEX RANGE SCAN | PRIMARY_KY_PARAMETERTABLE |
    | 10 | TABLE ACCESS BY INDEX ROWID | FDNMAPPINGTABLE |
    |* 11 | INDEX UNIQUE SCAN | SYS_C005695 |
    | 12 | NESTED LOOPS | |
    |* 13 | INDEX UNIQUE SCAN | PRIMARY_KY_PARAMETERTABLE |
    |* 14 | INDEX UNIQUE SCAN | PRIMARY_KEY_TRTABLE |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
    1 - filter( EXISTS (SELECT 0 FROM "TEMPLATERELATIONTABLE"
    "TEMPLATETAB2","PARAMETERTABLE" "PARAMTAB2" WHERE
    "PARAMTAB2"."ATTR_NAME"=:B1 AND "PARAMTAB2"."ID"=:B2 AND
    "PARAMTAB2"."ID"="TEMPLATETAB2"."TEMPLATE_ID" AND
    "TEMPLATETAB2"."ID"=:B3))
    5 - access("FDNTAB"."ID"=52787)
    6 - filter("PARAMTAB1"."ATTR_VALUE"<>'DEFAULT')
    7 - access("PARAMTAB1"."ID"="FDNTAB"."ID" AND
    PLAN_TABLE_OUTPUT
    "PARAMTAB1"."ATTR_NAME"='harqUsersMax')
    9 - access("PARAMTAB3"."ID"="FDNTAB"."ID")
    11 - access("PARAMTAB3"."ATTR_VALUE"="FDNTAB2"."FDN")
    13 - access("PARAMTAB2"."ID"=:B1 AND "PARAMTAB2"."ATTR_NAME"=:B2)
    14 - access("TEMPLATETAB2"."ID"=:B1 AND
    "PARAMTAB2"."ID"="TEMPLATETAB2"."TEMPLATE_ID")
    Note
    - rule based optimizer used (consider using cbo)
    43 rows selected.
    WITH INDEX HINT:
    select /*+INDEX(fdnmappingtable[PRIMARY_KY_FDNMAPPINGTABLE],parametertable[PRIMARY_KY_PARAMETERTABLE])*/ FdnTab2.fdn, paramTab3.attr_name from fdnmappingtable FdnTab, fdnmappingtable FdnTab2, parametertable paramTab1 ,parametertable paramTab3 where FdnTab.id=52787 and paramTab1.id= FdnTab.id and paramTab3.id = FdnTab.id and paramTab3.attr_value = FdnTab2.fdn and paramTab1.attr_name='harqUsersMax' and paramTab1.attr_value <> 'DEFAULT' and exists ( select ParamTab2.attr_name from parametertable ParamTab2, templaterelationtable TemplateTab2 where TemplateTab2.id=FdnTab.id and ParamTab2.id=TemplateTab2.template_id and ParamTab2.id=FdnTab2.id and ParamTab2.attr_name=paramTab1.attr_name);
    SQL> @$ORACLE_HOME/rdbms/admin/utlxpls.sql
    PLAN_TABLE_OUTPUT
    Plan hash value: 2924316070
    | Id | Operation | Name | Rows | B
    ytes | Cost (%CPU)| Time |
    PLAN_TABLE_OUTPUT
    | 0 | SELECT STATEMENT | | 1 |
    916 | 6 (0)| 00:00:01 |
    |* 1 | FILTER | | |
    | | |
    | 2 | NESTED LOOPS | | 1 |
    916 | 4 (0)| 00:00:01 |
    | 3 | NESTED LOOPS | | 1 |
    401 | 3 (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    | 4 | NESTED LOOPS | | 1 |
    207 | 2 (0)| 00:00:01 |
    |* 5 | TABLE ACCESS BY INDEX ROWID| PARAMETERTABLE | 1 |
    194 | 1 (0)| 00:00:01 |
    |* 6 | INDEX UNIQUE SCAN | PRIMARY_KY_PARAMETERTABLE | 1 |
    | 1 (0)| 00:00:01 |
    |* 7 | INDEX UNIQUE SCAN | PRIMARY_KY_FDNMAPPINGTABLE | 1 |
    PLAN_TABLE_OUTPUT
    13 | 1 (0)| 00:00:01 |
    | 8 | TABLE ACCESS BY INDEX ROWID | PARAMETERTABLE | 1 |
    194 | 1 (0)| 00:00:01 |
    |* 9 | INDEX RANGE SCAN | PRIMARY_KY_PARAMETERTABLE | 1 |
    | 1 (0)| 00:00:01 |
    | 10 | TABLE ACCESS BY INDEX ROWID | FDNMAPPINGTABLE | 1 |
    515 | 1 (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 11 | INDEX UNIQUE SCAN | SYS_C005695 | 1 |
    | 1 (0)| 00:00:01 |
    | 12 | NESTED LOOPS | | 1 |
    91 | 2 (0)| 00:00:01 |
    |* 13 | INDEX UNIQUE SCAN | PRIMARY_KEY_TRTABLE | 1 |
    26 | 1 (0)| 00:00:01 |
    |* 14 | INDEX UNIQUE SCAN | PRIMARY_KY_PARAMETERTABLE | 1 |
    65 | 1 (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
    1 - filter( EXISTS (SELECT /*+ */ 0 FROM "TEMPLATERELATIONTABLE" "TEMPLATETAB
    2","PARAMETERTABLE"
    PLAN_TABLE_OUTPUT
    "PARAMTAB2" WHERE "PARAMTAB2"."ATTR_NAME"=:B1 AND "PARAMTAB2"."ID"
    =:B2 AND
    "TEMPLATETAB2"."TEMPLATE_ID"=:B3 AND "TEMPLATETAB2"."ID"=:B4))
    5 - filter("PARAMTAB1"."ATTR_VALUE"<>'DEFAULT')
    6 - access("PARAMTAB1"."ID"=52787 AND "PARAMTAB1"."ATTR_NAME"='harqUsersMax')
    7 - access("FDNTAB"."ID"=52787)
    9 - access("PARAMTAB3"."ID"=52787)
    11 - access("PARAMTAB3"."ATTR_VALUE"="FDNTAB2"."FDN")
    13 - access("TEMPLATETAB2"."ID"=:B1 AND "TEMPLATETAB2"."TEMPLATE_ID"=:B2)
    14 - access("PARAMTAB2"."ID"=:B1 AND "PARAMTAB2"."ATTR_NAME"=:B2)
    PLAN_TABLE_OUTPUT
    Note
    - dynamic sampling used for this statement
    39 rows selected.

  • Accessing the records in ascending order using index hint

    I am getting a problem in selecting the rows using the index hint which in i want to query in the ascending order.
    for eg.
    select /*+ index(temp_itr_header,tmp_itrhdr_1#IDX2) */ person_id
    from temp_itr_header

    Oracle knows that it doesn't have to resort data if it accessed individual rows from an index with the same sort order. In other words, adding the ORDER BY clause need not cause Oracle to do any extra work. Adding the ORDER BY does guarantee that the results will be sorted and will tend to cause Oracle to use the index, assuming it can avoid the sort that way. If you don't have an ORDER BY, Oracle is free to return rows in whatever order it would like regardless of your hint.
    If you want to use the index hint, the syntax is
    SELECT /*+ INDEX(temp_itr_header <<index name>>) */Note that you do not want to have a comma in your hint. Of course, if your statistics are accurate, you shouldn't need to resort to a hint here-- the CBO should pick the most efficient path.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • MS 2000 Sql Index Hint In CFC Query

    How do you force the query in your function (component) to
    use the Index created. If you have some thing like this
    select *
    from class
    and a bunch of where clauses.
    Does CF allow for hints in the CFC's queries? any example?

    First it should automatically select the index. I would run
    it through query analyzer and see the exectution path. If you want
    to force and index..
    select * from class with INDEX(index1,index2..)

  • Insert with APPEND hint

    Hello,
    I have insert statment with APPEND hint. Here statment is as follows.
    INSERT /*+ APPEND */ INTO TEST SELECT * FROM EMP;
    The TEST table is in NOLOGGING mode.
    The table has FK constraint, trigger, index too. Obvisiouly, it would not write the data in redo log. Still does it insert the data above HWM.
    Thanks.

    When you use APPEND hint with INSERT, oracle never bother about the free blocks which are below HWM. It always writies in new blocks, i.e. above HWM.
    Jaffar

  • Why do I have to append URL with /index.htm on one KB?

    I have 7 different KBs I maintain on my webserver. I am using RoboHelp 7. For one of them, I have to append the URL with /index.htm, or it does not show the correct information. Examples of two of the KBs, and what happens with & without the index.htm appendeden
    I will happily provide any other information. I've been wondering about this for a long time, and it's finally driven me batty enough to ask. Thanks so much for any assistance. Greatly appreciate your input, this is a wonderful resource.
    http://wpa10suppliertest.am.mot-mobility.com/ opens a training KB for supplier information. See screenshot of the WebHelp Primary Layout:
    However, for http://wpa10user.am.mot-mobility.com/ if I do not append with http://wpa10user.am.mot-mobility.com/index.htm, I get no content, and the first skin I tried out. The settings are the same:
    http://wpa10user.am.mot-mobility.com/:
    http://wpa10user.am.mot-mobility.com/index.htm:

    Hi William,
    That makes sense - but I had looked at my IIS setups and they appear the same for all KBs, again here are settings for WPA Supplier & User. I created both the same day, the same way, and have compared all tabs which are identical. I can double check on how the DNS aliases that were set up, but they should have been identical as well

  • Problem with index in merged projects

    Dear Sir,
    I have a problem with index in the master project, I can only
    view the master project index keywords under the index tab. My
    master project contains 2 topics besides the other sub projects. I
    have created index for all sub projects indvidually and at the end
    I created the master project index.
    I made sure that the 'Binary Index' flag is ticked before
    compilation and stil the problem is on, do somebody know what could
    be the problem.

    Hi,
    Two points here.
    Firstly, you can duplicate SSL's. (Right click on an SSL in
    the projects sub-directory and select the duplicate layout option.
    This will give you a copy of the original SSL).
    I tend to have two SSL's - one is local and I use that every
    time I test compile the project when I'm working on it.
    The other is set to output to the master project. I use that
    once I'm happy with the sub-project and start working with the
    master project.
    Second point is to be aware of how RoboHelp treats the
    imported/merged .chm files from the sub projects.
    It imports them into the main project master directory - then
    when the master project is compiled it puts a copy of them into the
    master project SSL. However, if you re-compile it doesn't overwrite
    the files that are already in the master project SSL directory.
    This is why you have to be aware of where the sub project
    .chm files are going - you need to make sure that if you revise the
    sub projects, a fresh copy of the .chm files ends up in the output
    SSL directory of the master project.

  • Doubt with creation of Model in the application Webdynpro Java

    Good Morning,
    I have the following doubts with the fields when i am creating a models in WebDynpro Java
    Model Package
    Source Fólder
    Default logical system name for model instances
    Default logical system name for RFC metadata
    Logical Dictionary
    Dictionary Type Package.
    Can Help me?
    Kind Regards

    Hi,
        Please check this link:
    [https://wiki.sdn.sap.com/wiki/display/WDJava/FAQ%20-%20Models%20-%20Adaptive%20Web%20Service]
    Thanks and Regards

  • Transactional replication very slow with indexes on Subscriber table

    I have setup Transactional Replication for one of our databases where one table with about 5mln records is replicated to a Subsriber database. With every replication about 500-600.000 changed records are send to the Subscriber.
    Since one month I see very strange behaviour when I add about 10 indexes to the Subscriber table. As soon as I have added the indexes replication speed becomes extremely slow (almost 3 hours for 600k records). As soon as I remove the indexes the replication
    is again very fast, about 3 minutes for the same amount of records.
    I've searched a lot on the internet to solve this issue but can't find any explaination for this strange behaviour after adding the indexes. As far as I know it doesn't have to be a problem to add indexes to a Subscriber table, and it hasn't been before on
    another replication configuration we use.
    Some information from the Replication Log:
    With indexes on the Subscriber table
    Total Run Time (ms) : 9589938 Total Work Time : 9586782
    Total Num Trans : 3 Num Trans/Sec : 0.00
    Total Num Cmds : 616245 Num Cmds/Sec : 64.28
    Total Idle Time : 0 
    Writer Thread Stats
    Total Number of Retries : 0 
    Time Spent on Exec : 9580752 
    Time Spent on Commits (ms): 2687 Commits/Sec : 0.00
    Time to Apply Cmds (ms) : 9586782 Cmds/Sec : 64.28
    Time Cmd Queue Empty (ms) : 5499 Empty Q Waits > 10ms: 172
    Total Time Request Blk(ms): 5499 
    P2P Work Time (ms) : 0 P2P Cmds Skipped : 0
    Reader Thread Stats
    Calls to Retrieve Cmds : 2 
    Time to Retrieve Cmds (ms): 10378 Cmds/Sec : 59379.94
    Time Cmd Queue Full (ms) : 9577919 Full Q Waits > 10ms : 6072
    Without indexes on the Subscriber table
    Total Run Time (ms) : 89282 Total Work Time : 88891
    Total Num Trans : 3 Num Trans/Sec : 0.03
    Total Num Cmds : 437324 Num Cmds/Sec : 4919.78
    Total Idle Time : 0 
    Writer Thread Stats
    Total Number of Retries : 0 
    Time Spent on Exec : 86298 
    Time Spent on Commits (ms): 282 Commits/Sec : 0.03
    Time to Apply Cmds (ms) : 88891 Cmds/Sec : 4919.78
    Time Cmd Queue Empty (ms) : 1827 Empty Q Waits > 10ms: 113
    Total Time Request Blk(ms): 1827 
    P2P Work Time (ms) : 0 P2P Cmds Skipped : 0
    Reader Thread Stats
    Calls to Retrieve Cmds : 2 
    Time to Retrieve Cmds (ms): 2812 Cmds/Sec : 155520.63
    Time Cmd Queue Full (ms) : 86032 Full Q Waits > 10ms : 4026
    Can someone please help me with this issue? Any ideas? 
    Pim 

    Hi Megens:
    Insert statement might be slow with not only indexes and few others things too
    0) SQL DB Blocking during inserts
    1) If any insert triggers are existed
    2) Constraints - if any
    3) Index fragmentation
    4) Page splits / fill factor
    Without indexes inserts will be fast because, each time when new row going to insert to the table, SQL Server will do
    1) it will check for the room, if no room page splits will happen and record will placed at right place
    2) Once the record updated all the index should be update
    3) all these extra update work will cause can make insert statement bit slow
    Its better to have index maintenance jobs frequently to avoid fragmentation.
    If every thing is clear on SQL Server Side, you need look up on DISK IO, N/W Latency between the servers and so on
    Thanks,
    Thanks, Satish Kumar. Please mark as this post as answered if my anser helps you to resolves your issue :)

  • Pages for iPad is not recognizing the password I assigned to a document.  I included a hint, and I know I am entering the password that goes with the hint.  Is there anything I can do to access my doc?

    Pages for iPad is not recognizing the password I assigned to a document.  I included a hint, and I know I am entering the password associated with the hint.  Is there anything I can do to access my document?  i quite the Pages app and restarted it.  Now I guess I'll reset the iPad and see if that helps.   Thanks!

    Rhonda Fogel wrote:
    Interesting that one does not need the password to delete using Finder.
    The Pages password protects the contents of the document.  If there were a Finder password, it would protect what you might think of as the "file wrapper" ... the stuff around the file content.
    Glad it's not vital.  I have to say I only pasword protect those Pages documents that are, in fact, vital.
    Best of luck.

  • Problem with Shape Hints

    My professor and I are both stumped, so maybe someone can help me out?
    I'm using Flash CS4 (on a mac) and I'm trying to use shape tweens between two parallelograms. They are shapes and not symbols, since I hear you can't shape tween symbols.
    The transition is sometimes funky, so I try using shape hints to keep it from tangling. Sometimes they all work perfectly fine, sometimes only 1-2 points cooperate, and sometimes Flash ignores them altogether.
    They are snapped to the appropriate vertices, they're in the right order, and they're the right colors to signify they've been placed properly (none are red). I also started with "a" as the top left and placed them counterclockwise, which the Adobe tutorial said to do. I've consulted a dozen or so other tutorials and none of them address this problem. I don't think it's the computer - I've tried it on my laptop and several of the desktops in the design labs and ran into the same problem.
    Is anyone good with shape hints that can tell me what I'm missing?

    I've been trying it and Flash is being consistently inconsistent. I'm doing the same thing to dozens and dozens of squares and still can't find any rhyme or reason, it just works some times and not others. I thought it might have to do with the top left corners being moved to the not-top-left, but when I adjusted that it only worked for a few things. I'm just gonna accept defeat, I'm just surprised that I've got the same problem on every computer I try but can't find anyone else experiencing it.

  • How to batch rename with index/counter all files in a project?

    I have a project with files named with an index (I believe that is the correct term).  For example, the files are named XX1, XX2, and so on.  However, some files have the same name because I imported from two different memory cards, without thinking to set the starting number for the second import into the same project.  I would like to batch rename all of the files (masters and versions) with a consecutive index (1, 2, 3, and so on).  How can this be done?  I have found in the manual the way to do this on import, but not how to correct my mistake now.  Thanks!

    I would like to batch rename all of the files (masters and versions) with a consecutive index (1, 2, 3, and so on).
    Select the images in the project and then use ( from the main Aperture application menu)
         Matadata -> Batch Change (Shift-Command-B)
    Set the Version Name format to one of the "Custom with Index ..." or "Custom with Counter ..." formats and check "Apply to Master Files". Make sure you disable all other changes that you do not want, like Time Zone correction, or keywords.
    Regards
    Léonie

  • Oracle 9i ignores INDEX hint

    Hello,
    I try to convince Oracle to do a index scan rather then a full table scan in a query. To
    do this I created a view on top of the table which simply adds this hint:
    CREATE OR REPLACE VIEW V_FHDDSC3_FACT_DATA_4WEEK AS
    SELECT /*+ INDEX(T P_FHDDSC3_FACT_DATA_4WEEK) */
    T.*
    FROM T_FHDDSC3_FACT_DATA_4WEEK T
    The whole query is here:
    SELECT v_fhddsc3_geography_dim.geog_tag, v_fhddsc3_product_dim.prod_tag,
    v_fhddsc3_time_4week_dim.time_tag, v_fhddsc3_fact_data_4week.m001,
    v_fhddsc3_fact_data_4week.m002, v_fhddsc3_fact_data_4week.m003,
    v_fhddsc3_fact_data_4week.m004, v_fhddsc3_fact_data_4week.m005,
    v_fhddsc3_fact_data_4week.m006, v_fhddsc3_fact_data_4week.m007,
    v_fhddsc3_fact_data_4week.m008, v_fhddsc3_fact_data_4week.m009,
    v_fhddsc3_fact_data_4week.m010
    FROM v_fhddsc3_geography_dim,
    v_fhddsc3_time_4week_dim,
    v_fhddsc3_fact_data_4week,
    v_fhddsc3_product_dim
    WHERE ( v_fhddsc3_geography_dim.geog_key =
    v_fhddsc3_fact_data_4week.geog_key
    AND v_fhddsc3_product_dim.prod_key =
    v_fhddsc3_fact_data_4week.prod_key
    AND v_fhddsc3_time_4week_dim.time_key =
    v_fhddsc3_fact_data_4week.time_key
    AND ( v_fhddsc3_geography_dim.geog_tag IN
    (:"SYS_B_00",
    :"SYS_B_01",
    :"SYS_B_02",
    :"SYS_B_03",
    :"SYS_B_04",
    :"SYS_B_05",
    :"SYS_B_06",
    :"SYS_B_07",
    :"SYS_B_08"
    AND v_fhddsc3_product_dim.hierarchy_level IN (:"SYS_B_09")
    AND v_fhddsc3_time_4week_dim.time_tag IN
    (:"SYS_B_10",
    :"SYS_B_11",
    :"SYS_B_12",
    :"SYS_B_13",
    :"SYS_B_14",
    :"SYS_B_15",
    :"SYS_B_16",
    :"SYS_B_17",
    :"SYS_B_18",
    :"SYS_B_19",
    :"SYS_B_20",
    :"SYS_B_21",
    :"SYS_B_22",
    :"SYS_B_23",
    :"SYS_B_24",
    :"SYS_B_25",
    :"SYS_B_26",
    :"SYS_B_27",
    :"SYS_B_28",
    :"SYS_B_29",
    :"SYS_B_30",
    :"SYS_B_31",
    :"SYS_B_32",
    :"SYS_B_33",
    :"SYS_B_34",
    :"SYS_B_35",
    :"SYS_B_36"
    The execution plan shows a full table scan on T_FHDDSC3_FACT_DATA_4WEEK.
    The index is the primary key of the table containing PROD_KEY, GEOG_KEY and TIME_KEY.
    Why is Oracle 9i ignoring index hints?
    I came across the same problem some months ago, when we migrated one database from 8i to 9i. After that an INDEX_ASC hint was suddenly ignored. We used an index + and INDEX_ASC hint to sort a hierarchical query.
    We had to change the algorithmn and use a Database function to get it sorted right. This is painfull and slow.
    Any ideas?
    Kai

    Kai,
    Remember a hint is just that, a hint to the optimizer, it does not override the execution plan created by the optimizer. Possibilities are that the statistics in the database are out of date, which will affect the Cost based optimizer. Indexes on views are tricky as they would rely on the indexes on the underlying tables.
    Few AskTom links which may help:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:1705043::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:313416745628,%7Bhint%7D%20and%20%7Bindex%7D
    http://asktom.oracle.com/pls/ask/f?p=4950:8:1705043::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:641623836427,%7Bhint%7D%20and%20%7Bindex%7D
    http://asktom.oracle.com/pls/ask/f?p=4950:8:1705043::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1197786003246,%7Bhint%7D%20and%20%7Bindex%7D
    Sometimes the full scan can be quicker, than the index depending on the query.
    Regds
    Dave

  • Doubt with a Insert query!

    hi friends i have a doubt with a query in sql here is the following code.
    INSERT INTO
                         (SELECT employee_id, last_name,
                                      email, hire_date, job_id, salary,
                                      department_id
                           FROM employees
                          WHERE department_id = 50)
               VALUES (99999, 'Taylor', 'DTAYLOR',
                            TO_DATE('07-JUN-99', 'DD-MON-RR'),
                             'ST_CLERK', 5000, 50);The same insert statement can be achieved with
    INSERT INTO EMPLOYEES (employee_id, last_name,
                                      email, hire_date, job_id, salary,
                                      department_id)
                        VALUES (99999, 'Taylor', 'DTAYLOR',
                            TO_DATE('07-JUN-99', 'DD-MON-RR'),
                             'ST_CLERK', 5000, 50);What advantage does the first query have over the second one.
    Thanks in advance to everyone.
    Regards,
    Manoj

    Those two statements are identical.
    However this one would be different:
    INSERT INTO
      (SELECT employee_id, last_name,
            email, hire_date, job_id, salary,
            department_id
       FROM employees
       WHERE department_id = 50
       with check option )
    VALUES (99999, 'Taylor', 'DTAYLOR', TO_DATE('07-JUN-99', 'DD-MON-RR'), 'ST_CLERK', 5000, 50);The "WITH CHECK OPTION" would guarantee that only employees for department 50 are inserted.
    see also:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_10002.htm#i2066598
    Edited by: Sven W. on Mar 17, 2011 7:22 PM - typo correction

  • Collect statement with index

    Hi
    can anyone give me some idea  how to use collect statement with index
    here in the below syntax i want to use collect instead of insert.
    INSERT WA_ALVDISPLAY   INTO IT_ALVDISPLAY  index  3 .
    thanks.
    vivekk

    hi
    my scenario is like this
    i need an yearly report of a examination held in a school based on month,each month they need report for girls and boys separately
    the output format should be like this
    month:marks( boys)  marks( girls )
    so i have created 3 internal tables suppose itab ,itab1,itab2.
    itab1-month1
    itab1-boy_sub1
    itab1-boy_sub2
    itab2-month2
    itab2-girl_sub1
    itab2-girl_sub2
    itab -month1
    itab -boy_sub1
    itab -boy_sub2
    itab -girl_sub1
    itab -girl_sub2
    first i am looping in itab1 and using COLLECT statement i am inserting data to itab (bez in a month more than one exam can happen)
    i got boys mark in itab,then i need to put girls mark on the same row based on month
    based on particular index i need to insert data, moreover i need to use COLLECT statement for getting the total of particular month
    thanks
    vivek

Maybe you are looking for

  • No longer under warranty, how does pricing work?

    Seen as it's impossible to contact Apple directly regarding technical issues regarding MacBook, I'll have to ask here. Firstly, I know the issues with my MacBook are hardware related I've spent relentless hours trying to fix them with thousands of di

  • Create a cache for external map source - Error in parsing xml request.

    When doing the following: Create a cache for external map source I get "error in parsing xml request" when setting the following Map service Url: http://neowms.sci.gsfc.nasa.gov/wms/wms?version=1.3.0&service=WMS&request=GetCapabilities It looks like

  • Update Review on App Store?

    Can someone please tell me how I change/update a review I made in the iPhone App Store? I've looked high and low and cannot find anything about this. I know it's possible because I've seen numerous reviews that have later been updated (e.g., increase

  • Problem in installing EclipseME 0.9.2

    Hello I use eclipse 3.1. I want to make java code for TC65 from Siemens. Now I have to install the plugin EclipseME 0.9.2 and I get the message from eclipse: No features found on the selected site(s). Choose a different site or site category. What I'

  • ScriptUIFlex.dll APPCRASH-PS-CS-6

    Been using CS-6 for months with no problems; but got 2 recent APPCRASH as per below:  Ref. Win-7-64 / Intel i7 / 16GB RAM/ Graphics Processor, & Open GL Level Date and Time Source Event ID Task Category Information 10/14/2013 5:49:18 PM Windows Error