Optimizer not using index even after giving the hint
Hi All,
I am wondering why Optimixzer is not using the index in the below query
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
SQL> select column_expression
2 from ALL_IND_EXPRESSIONS
3 where table_name like 'GTXN_DTL_V1'
4 and index_name = 'IDX_TXN11_V1';
COLUMN_EXPRESSION
TO_DATE("BOOKING_DATE",'YYYYMMDD')
SQL> select num_rows from all_tables
2 where table_name like 'GTXN_DTL_V1';
NUM_ROWS
29020867
SQL> explain plan for select * from gtxn_dtl_v1 where to_date(booking_date,'yyyymmdd') = to_date('030109','DDMMRR');
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 3140624094
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 55489 | 15M| 215K (4)| 00:43:08 |
|* 1 | TABLE ACCESS FULL| GTXN_DTL_V1 | 55489 | 15M| 215K (4)| 00:43:08 |
Predicate Information (identified by operation id):
1 - filter(TO_DATE("BOOKING_DATE",'yyyymmdd')=TO_DATE('030109','DDMMRR
14 rows selected.
--Giving Hint..
SQL> explain plan for select /*+ index(gtxn_dtl_v1 IDX_TXN11_V1) */ *
2 from gtxn_dtl_v1
3 where to_date(booking_date,'yyyymmdd') = to_date('030109','DDMMRR')
4 /
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 3140624094
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 55489 | 15M| 215K (4)| 00:43:08 |
|* 1 | TABLE ACCESS FULL| GTXN_DTL_V1 | 55489 | 15M| 215K (4)| 00:43:08 |
Predicate Information (identified by operation id):
1 - filter(TO_DATE("BOOKING_DATE",'yyyymmdd')=TO_DATE('030109','DDMMRR
14 rows selected.Please suggest.
Thanks in advance,
Jeneesh
porzer wrote:
Hi!
Why are you using the to_date ont the booking_date column? Is it a varchar2 column, what type is it.
Because if it's a varchar2 column you could simply use
select * from gtxn_dtl_v1 where booking_date = '20090103';
So you wouldn't even need a function based index.
On the other hand if it's a date you shouldn't do a to_date as well.
Best regards,
PPThat is not the original qury used in production. I am investigating on the prformance of the below query.
select txn.account_number,to_number(txn.amount_lcy) txn_amt,to_date(booking_date,'yyyymmdd') TXN_DATE,
sal.latest_sal,sal.sal_date,customer_name,employer_name,
decode(COMMUNICATION_TYPE_1,'MOBILE',COMMUNICATION_NO_1,decode(COMMUNICATION_TYPE_2,'MOBILE',COMMUNICATION_NO_2)) mob,
txn.CURRENCY, CHEQUE_NUMBER,trans_dets,trans_reference,target,teller_id,acc.category,acc.inactive_marker,acc.posting_restrict,cus.sector,cus.industry
from coreadmin.Gtxn_dtl_v1 txn,
(select account_number,round(to_number(nvl(amount_lcy,0)),2) latest_sal,TXN_DATE sal_date,rr
from
(select to_date(booking_date,'yyyymmdd') TXN_DATE,batch_id,account_number,amount_lcy
,row_number() over (partition by account_number order by to_date(booking_date,'yyyymmdd') desc NULLS LAST,batch_id desc nulls last) rr,
CURRENCY, CHEQUE_NUMBER,trans_dets,trans_reference
from coreadmin.Gtxn_dtl_v1
where transaction_code = '204'
and to_number(amount_lcy) > 0)
where rr = 1
) sal,customers_live cus,accounts_live acc
where to_date(booking_date,'yyyymmdd') between to_date('030109','DDMMRR') and to_date('030209','DDMMRR')
and txn.account_number = sal.account_number
and txn.CUSTOMER_ID = cus.CUSTOMER_number(+)
and acc.id = sal.account_number
and target in ('30','31','32')Edited by: jeneesh on Mar 25, 2009 12:38 PM
Corrected the query.
The column is of VARCHAR2 type. This is because, the table is loaded, through sqlldr, every day from flat files generated form GLOBUS banking system. Column is kept as VARCHAR2 to minimize the loading issues.
Similar Messages
-
I have been using RoboForm. Now I can not use it even after PURCHASING THE latest vr!
I have been trying for the last TWO days to get Roboform to work with the new Firefox! I have even ''purchased'' the latest version of Roboform but I still can not get its tool bar to appear on Firefox. After trying to follow your support's instructions, I can not get it to work with Firefox! I can get it to work with MS Windows Internet Explorer!
What a mess! I will not use Firefox again!check out this link which answers your question http://support.apple.com/kb/HT1242
after re reading your post, I think you need an SMC reset instead: http://support.apple.com/kb/ht3964
what does activity monitor show? screenshots? -
The forward, back, refresh, and stop buttons are not working. Even after installing the latest Firefox update. Also my home page stopped loading upon startup even tho I have it setup to do so. Anyone else experiencing these issues? This is my second request for help and of course, Firefox on-line support is always closed.
Those are all symptoms of a problem with the places.sqlite file, for details see http://kb.mozillazine.org/Locked_or_damaged_places.sqlite
-
Protect The Cells in the Excel Sheet Even After giving the password.
Hi All,
I need to protect the cells in the report even after unprotecting the sheet after giving password.
That is, i have used some excel formulas in some cells, these cells are to be protected.
In Reports using EVDRE all the cells are getting, "Locked" option selected in the Protection tab by default. Even if we change that Option and refresh the sheet Locked is getting selected again.
So once we Protect the sheet using password all cells are getting locked. But once we remove password all cells are free to enter.
I want the user of the Sheet to use only certain columns in the Sheet. and all the other columns should not be user editable.
Please help me out in solving this issue.
Thanks in Advance,
Regards,
G.Vijaya KumarHi Vijaya,
I tested in my test environment and even after refresh , the range cells are still editable, they didnt get locked. I did the following:
1. Selected the range or column in Excel, then Tools - Protection - Allow users to edit range. I selected the range and gave the password.
2. Next I protected the complete sheet.
3. Now entire sheet is protected. Now again I selected the range in which I want to edit, first time it will ask for password which you gave for the range. So I gave and I was able to edit the cells.
4. I selected other cells and was not able to edit it so they are still locked.
5. I tried to refresh the report , and then I selected the range cells to edit and still I was able to edit it. Those cells didnt get locked.
So did you do the same things?
Thanks. -
My Ipad does not go off again, even after pressing the off button and re set, what can I do to switch the I pad off.
Try a reset a few more times.
Hold the Sleep and Home button down until you see the Apple logo.
Data will not be affected. -
DBAs,
I have a select query which is using index scan when quired in prod. database and is executing in 20secs.and is using full table scan in non prod. db and is taking 48 secs.I rebuilded indexes & took stats in non-prod db but even it is taking 47 secs.
Please advice......Here are the details
EXECUTE DBMS_STATS.GATHER_SCHEMA_STATS( -ownname => 'TCD_PRD_STG', -
estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE, -
method_opt => 'for all columns size AUTO' -
SQL> EXECUTE DBMS_STATS.GATHER_SCHEMA_STATS (‘JOE’,’EMPLOYEE’);
EXECUTE DBMS_STATS.GATHER_SCHEMA_STATS('TCD_PRD_STG',DBMS_STATS.AUTO_SAMPLE_SIZE);
1)Oracle versions are 10.2.0.2 in both prod & non-prod.
2)Explain plan of prod. db
SQL> SELECT ITEM_REFERENCE_ID FROM (SELECT DISTINCT * FROM ITEMS WHERE PUBLICATION_ID=20 AND ITEM_T
YPE=16 AND ( ( ( SCHEMA_ID=31 ) ) AND ( ( (ITEM_REFERENCE_ID IN (SELECT ITEM_REFERENCE_ID FROM
( SELECT ITEM_REFERENCE_ID, COUNT(KEYWORD) AS tempkeywordcount FROM ITEM_CATEGORIES_AND_KEYWORDS WHE
RE KEYWORD IN ('Africa') AND CATEGORY = 'Region' AND PUBLICATION_ID=20 GROUP BY ITEM_REFERENCE_ID) t
empselectholder WHERE tempkeywordcount=1)) OR (ITEM_REFERENCE_ID IN (SELECT ITEM_REFERENCE_ID FROM (
SELECT ITEM_REFERENCE_ID, COUNT(KEYWORD) AS tempkeywordcount FROM ITEM_CATEGORIES_AND_KEYWORDS WHER
E KEYWORD IN ('Aig') AND CATEGORY = 'Region' AND PUBLICATION_ID=20 GROUP BY ITEM_REFERENCE_ID) temps
electholder WHERE tempkeywordcount=1)) ) ) ) ORDER BY LAST_PUBLISHED_DATE DESC) WHERE ROWNUM<51;
no rows selected
Elapsed: 00:00:21.74
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=192 Card=50 Bytes=
650)
1 0 COUNT (STOPKEY)
2 1 VIEW (Cost=192 Card=79 Bytes=1027)
3 2 SORT (ORDER BY STOPKEY) (Cost=192 Card=79 Bytes=92272)
4 3 HASH (UNIQUE) (Cost=191 Card=79 Bytes=92272)
5 4 FILTER
6 5 TABLE ACCESS (BY INDEX ROWID) OF 'ITEMS' (TABLE)
(Cost=190 Card=808 Bytes=943744)
7 6 INDEX (RANGE SCAN) OF 'IDX_ITEMS_PUB_URL' (IND
EX) (Cost=107 Card=17024)
8 5 FILTER
9 8 HASH (GROUP BY) (Cost=42 Card=1 Bytes=540)
10 9 TABLE ACCESS (BY INDEX ROWID) OF 'ITEM_CATEG
ORIES_AND_KEYWORDS' (TABLE) (Cost=41 Card=1 Bytes=540)
11 10 INDEX (RANGE SCAN) OF 'IX_ITEM_KEYWORDS' (
INDEX) (Cost=35 Card=7403)
12 5 FILTER
13 12 HASH (GROUP BY) (Cost=3 Card=1 Bytes=540)
14 13 TABLE ACCESS (BY INDEX ROWID) OF 'ITEM_CATEG
ORIES_AND_KEYWORDS' (TABLE) (Cost=2 Card=1 Bytes=540)
15 14 INDEX (RANGE SCAN) OF 'IX_ITEM_KEYWORDS' (
INDEX) (Cost=1 Card=50)
Statistics
21 recursive calls
0 db block gets
4950582 consistent gets
4060 physical reads
13100 redo size
240 bytes sent via SQL*Net to client
333 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
0 rows processed
explain plan of non-prod db
1* SELECT ITEM_REFERENCE_ID FROM (SELECT DISTINCT * FROM ITEMS WHERE PUBLICATION_ID=20 AND ITEM_T
SQL> /
ITEM_REFERENCE_ID
96672
96680
Elapsed: 00:00:47.74
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=502 Card=50 Bytes=
650)
1 0 COUNT (STOPKEY)
2 1 VIEW (Cost=502 Card=255 Bytes=3315)
3 2 SORT (ORDER BY STOPKEY) (Cost=502 Card=255 Bytes=40035
4 3 HASH (UNIQUE) (Cost=501 Card=255 Bytes=40035)
5 4 FILTER
6 5 TABLE ACCESS (FULL) OF 'ITEMS' (TABLE) (Cost=500
Card=2618 Bytes=411026)
7 5 FILTER
8 7 HASH (GROUP BY) (Cost=881 Card=1 Bytes=29)
9 8 TABLE ACCESS (FULL) OF 'ITEM_CATEGORIES_AND_
KEYWORDS' (TABLE) (Cost=880 Card=11 Bytes=319)
10 5 FILTER
11 10 HASH (GROUP BY) (Cost=881 Card=1 Bytes=29)
12 11 TABLE ACCESS (FULL) OF 'ITEM_CATEGORIES_AND_
KEYWORDS' (TABLE) (Cost=880 Card=1 Bytes=29)
Statistics
0 recursive calls
0 db block gets
5912606 consistent gets
0 physical reads
0 redo size
387 bytes sent via SQL*Net to client
435 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
2 rows processed -
Tree Table icons not getting cleared even after applying the CSS
Hi,
I need to change the tree table expanded and collapsed and the lead node icon.
Leaf node icon is getting changed properly but the remaining two are appled improperly.
In the background the old default image is getting redered and on top of that the newly given image is shown.
These are .css statemets used for changing the icons.
af|treeTable::expanded-icon{content:url(/org/calwin/ui/superweb/image/yellowBlueMarker-minus_trans.gif);
background: none ;}
af|treeTable::collapsed-icon{content:url(/org/calwin/ui/superweb/image/yellowBlueMarker_trans_plus.gif);
background: none}
af|treeTable::leaf-icon{content:url(/org/calwin/ui/superweb/image/blueCircleMarker_trans.gif);
background: none}
Can someone suggest a solution for this.
Thanks,
Praveen.Hi Frank,
I tried including -tr-inhibit:all;
but it didn't work.
Here's my skin registration tag in trinidaad-skins.xml
<skin>
<id>customSkin.desktop</id>
<family>CustomSkin</family>
<extends>fusion.desktop</extends>
<render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
<style-sheet-name>org/calwin/ui/superweb/skin/css/customFusion.css</style-sheet-name>
</skin>
Can there be any other reason for not being applied properly.
The images mentioned in the css are properly rendered but in the background
default images are still coming.
Please suggest.. -
Not getting alerts even after applied the monitoring policy on user defined group.
Hi,
recently we have installed OEM Ops center 12c for monitoring our oracle servers. I have created a user defined group and applied a userdefined monitoring policy on that group. I have threshold 70% as crtical and 50 % as warning in my monitoring policy.
Some of my servers are having 77% disk utlization and im not getting any alerts for that.
What will be the problem?
When i see the membership of particular group (group -> membership in center pane), im not able to see the monitoring policy name on the monitoring policy column but i have applied policy on that group.
Please help me to resolve the issue.
Thanks,
VeijarHi Stijn,
Thanks for the response.
You are right. I was sending personalized iBot to group 'Financial Analyst'. A non-OBI user(Reshmi) belongs to this group.
But still problem has not been completely resolved.Still users in group either Administrator/Financial Analyst not getting alert via mail.
Atleast the users in Administrator group should get alert via mail, since both are defined in rpd.
Now when i send non-personalized ibot to group 'Financial Analyst', All the users other than Reshmi get alert on their dashboard but they don't get alert
via mail.Also Reshmi does not get alert via mail and error file shows error like -
No devices for user: Reshmi.
Now i am not getting the error nQSError: 43001 Authentication failed for Reshmil in repository Star: invalid user/password. (08004)
which i was getting earlier while sending personalized ibot.
I have already defined the Mail tab contents using Job Manager. Also i have selected User Destinations both Interactive Dashboard and Active Delivery
Profile.
Why the users don't get alert via mail? What could be the problem? -
everytime I close Firefox, it select the option "Read-only".
I stop the proces via Task management and then I can start Firefox again. I close it and the "Red-only" option is back again.Do you get this error only after closing and restarting Firefox or always?
In case of the latter:
Do you still have a default profile and is the profile as you see in the profiles.ini file marked as "Default=1" still present?
*http://kb.mozillazine.org/Profile_folder_-_Firefox
Try to delete the profiles.ini file to force Firefox to create a new profiles.ini file and a new default profile.
*http://kb.mozillazine.org/profiles.ini_file
*https://support.mozilla.org/kb/Firefox+is+already+running+but+is+not+responding
*http://kb.mozillazine.org/Profile_in_use -
Cursor remains in the selectionscreen even after giving the possible inputs
I am working for an Upgrade project (upgradation from 4.6 version to ECC 6 version) and the problem is in the ECC 6 Version.
When I press on the execute button or F8 from the selection screen by giving all the possible inputs, cursor position still remains in the same screen giving some status message in some different language other than English which i cannot understand i.e. Program is maintained in some other language other than English.
This program is giving output for the same inputs in the 4.6 version.
can anyone help me regarding this issue by letting me know some possible solution.Hi,
execute in debigging mode and analyse the results. you can find out the problem were it is coming from.
regards.
sriram. -
Index is not getting picked even after providing hint
Hi All
The index pk_sku is not getting picked even after providing the hints when executing the query.Please kindly give me such recommendations.I am providing the information.
select * from
(select /*+ index(s pk_sku) */
to_char(t.dstamp, 'YYYYmmDDHH24MI') as sort_1,
t.client_id as CLIENT_ID ,
t.site_id as SITE_ID,
tz.time_zone_name as TIME_ZONE_NAME ,
t.owner_id as OWNER_ID,
t.sku_id as SKU_ID,
t.reason_id as ADJUST_TYPE,
to_char(t.dstamp+tz.diff/24, 'DD/mm/YYYY HH24:MI') as ADJUST_DATETIME,
t.reference_id as RECEIPT_ID,
t.batch_id as BATCH_ID,
t.update_qty as UPDATE_QTY,
t.lock_code as LOCK_CODE,
s.description as SKU_DESCRIPTION
from mv_inventory_transaction t
JOIN timezone tz ON tz.site_id = t.site_id ,
mv_sku s
where t.sku_id= s.sku_id
and t.client_id=s.client_id
and ( :client is null or :client = t.client_id)
and ( :site is null or t.site_id in (:site))
and ( :owner is null or t.owner_id in (:owner))
and t.code= 'Adjustment'
and (t.dstamp+tz.diff/24) between to_date(:dateFrom, 'DD/mm/yyyy') and to_date(:dateTo,'DD/mm/yyyy')+1
and (:sku is null or t.sku_id in (:sku))
UNION ALL
(select /*+ index(s pk_sku) */
to_char(t.dstamp, 'YYYYmmDDHH24MI') as sort_1,
t.client_id as CLIENT_ID ,
t.site_id as SITE_ID,
tz.time_zone_name as TIME_ZONE_NAME ,
t.owner_id as OWNER_ID,
t.sku_id as SKU_ID,
t.reason_id as ADJUST_TYPE,
to_char(t.dstamp+tz.diff/24, 'DD/mm/YYYY HH24:MI') as ADJUST_DATETIME,
t.reference_id as RECEIPT_ID,
t.batch_id as BATCH_ID,
t.update_qty as UPDATE_QTY,
t.lock_code as LOCK_CODE,
s.description as SKU_DESCRIPTION
from mv_inventory_transaction_arch t
JOIN timezone tz ON tz.site_id = t.site_id,
mv_sku s
where t.sku_id= s.sku_id
and t.client_id=s.client_id
and ( :client is null or :client = t.client_id)
and ( :site is null or t.site_id in (:site))
and ( :owner is null or t.owner_id in (:owner))
and t.code= 'Adjustment'
and (t.dstamp+tz.diff/24) between to_date(:dateFrom, 'DD/mm/yyyy') and to_date(:dateTo,'DD/mm/yyyy')+1
and (:sku is null or t.sku_id in (:sku))
order by sort_1,2,3,4,5
version = Release 10.1.0.5.0
SQL> sho parameter optimizer
NAME TYPE VALUE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 10.1.0.5
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
optimizer_mode string ALL_ROWS
sho parameter db_file_multiblock_count_read
sho parameter cursor_sharing
SQL> sho parameter optimizer
NAME TYPE VALUE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 10.1.0.5
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
optimizer_mode string ALL_ROWS
SQL> sho parameter db_file_multi
NAME TYPE VALUE
db_file_multiblock_read_count integer 16
SQL> sho parameter cursor_sharing
NAME TYPE VALUE
cursor_sharing string EXACTExplain plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 56 | 29736 | 345K (1)| 01:09:07 |
| 1 | SORT ORDER BY | | 56 | 29736 | 345K (1)| 01:09:07 |
| 2 | VIEW | | 56 | 29736 | 345K (1)| 01:09:07 |
| 3 | UNION-ALL | | | | | |
| 4 | NESTED LOOPS | | 2 | 984 | 29686 (1)| 00:05:57 |
| 5 | HASH JOIN | | 1 | 326 | 26870 (1)| 00:05:23 |
| 6 | TABLE ACCESS FULL | TIMEZONE | 4 | 88 | 3 (0)| 00:00:01 |
| 7 | VIEW | MV_INVENTORY_TRANSACTION | 25 | 7600 | 26866 (1)| 00:05:23 |
| 8 | UNION-ALL | | | | | |
| 9 | FILTER | | | | | |
| 10 | MAT_VIEW ACCESS BY INDEX ROWID| MV_INVENTORY_TRANSACTION | 1 | 67 | 24327 (1)| 00:04:52 |
| 11 | INDEX RANGE SCAN | IDX_CODE_CLIENTID_690 | 79681 | | 518 (1)| 00:00:07 |
| 12 | FILTER | | | | | |
| 13 | MAT_VIEW ACCESS BY INDEX ROWID| MV_INVENTORY_TRANSACTION | 24 | 2328 | 2539 (1)| 00:00:31 |
| 14 | INDEX RANGE SCAN | IDX_CODE_646 | 9269 | | 46 (0)| 00:00:01 |
| 15 | VIEW | MV_SKU | 37 | 6142 | 2816 (1)| 00:00:34 |
| 16 | UNION-ALL | | | | | |
| 17 | MAT_VIEW ACCESS FULL | MV_SKU | 335K| 10M| 2535 (1)| 00:00:31 |
| 18 | MAT_VIEW ACCESS FULL | MV_SKU | 37839 | 1699K| 280 (1)| 00:00:04 |
| 19 | NESTED LOOPS | | 54 | 26568 | 315K (1)| 01:03:10 |
| 20 | HASH JOIN | | 1 | 326 | 313K (1)| 01:02:37 |
| 21 | TABLE ACCESS FULL | TIMEZONE | 4 | 88 | 3 (0)| 00:00:01 |
| 22 | VIEW | MV_INVENTORY_TRANSACTION_ARCH | 576 | 171K| 313K (1)| 01:02:37 |
| 23 | UNION-ALL | | | | | |
| 24 | FILTER | | | | | |
| 25 | MAT_VIEW ACCESS BY INDEX ROWID| MV_INVENTORY_TRANSACTION_ARCH | 1 | 72 | 19258 (1)| 00:03:52 |
| 26 | INDEX RANGE SCAN | QUI_IDX_INVTRANS_ARC1 | 36016 | | 287 (1)| 00:00:04 |
| 27 | FILTER | | | | | |
| 28 | MAT_VIEW ACCESS BY INDEX ROWID| MV_INVENTORY_TRANSACTION_ARCH | 575 | 55200 | 293K (1)| 00:58:45 |
| 29 | INDEX RANGE SCAN | QUI_IDX_INVTRANS_ARC1 | 367K| | 3466 (1)| 00:00:42 |
| 30 | VIEW | MV_SKU | 37 | 6142 | 2816 (1)| 00:00:34 |
| 31 | UNION-ALL | | | | | |
| 32 | MAT_VIEW ACCESS FULL | MV_SKU | 335K| 10M| 2535 (1)| 00:00:31 |
| 33 | MAT_VIEW ACCESS FULL | MV_SKU | 37839 | 1699K| 280 (1)| 00:00:04 |
------------------------------------------------------------------------------------------------------------------------when put in sql tuning advisor,It recommended with better plan using indexes
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 56 | 29736 | 340K (1)| 01:08:01 |
| 1 | SORT ORDER BY | | 56 | 29736 | 340K (1)| 01:08:01 |
| 2 | VIEW | | 56 | 29736 | 340K (1)| 01:08:01 |
| 3 | UNION-ALL | | | | | |
| 4 | NESTED LOOPS | | 2 | 848 | 26900 (1)| 00:05:23 |
| 5 | HASH JOIN | | 1 | 326 | 26898 (1)| 00:05:23 |
| 6 | TABLE ACCESS FULL | TIMEZONE | 4 | 88 | 3 (0)| 00:00:01 |
| 7 | VIEW | MV_INVENTORY_TRANSACTION | 25 | 7600 | 26894 (1)| 00:05:23 |
| 8 | UNION-ALL | | | | | |
| 9 | FILTER | | | | | |
| 10 | MAT_VIEW ACCESS BY INDEX ROWID| MV_INVENTORY_TRANSACTION | 1 | 67 | 24352 (1)| 00:04:53 |
| 11 | INDEX RANGE SCAN | IDX_CODE_CLIENTID_690 | 79681 | | 518 (1)| 00:00:07 |
| 12 | FILTER | | | | | |
| 13 | MAT_VIEW ACCESS BY INDEX ROWID| MV_INVENTORY_TRANSACTION | 24 | 2328 | 2542 (1)| 00:00:31 |
| 14 | INDEX RANGE SCAN | IDX_CODE_646 | 9269 | | 46 (0)| 00:00:01 |
| 15 | VIEW | MV_SKU | 37 | 3626 | 2 (0)| 00:00:01 |
| 16 | UNION-ALL PARTITION | | | | | |
| 17 | MAT_VIEW ACCESS BY INDEX ROWID | MV_SKU | 1 | 34 | 3 (0)| 00:00:01 |
| 18 | INDEX UNIQUE SCAN | PK_SKU | 1 | | 2 (0)| 00:00:01 |
| 19 | MAT_VIEW ACCESS BY INDEX ROWID | MV_SKU | 1 | 46 | 2 (0)| 00:00:01 |
| 20 | INDEX UNIQUE SCAN | PK_SKU | 1 | | 1 (0)| 00:00:01 |
| 21 | NESTED LOOPS | | 54 | 22896 | 313K (1)| 01:02:38 |
| 22 | HASH JOIN | | 1 | 326 | 313K (1)| 01:02:38 |
| 23 | TABLE ACCESS FULL | TIMEZONE | 4 | 88 | 3 (0)| 00:00:01 |
| 24 | VIEW | MV_INVENTORY_TRANSACTION_ARCH | 576 | 171K| 313K (1)| 01:02:38 |
| 25 | UNION-ALL | | | | | |
| 26 | FILTER | | | | | |
| 27 | MAT_VIEW ACCESS BY INDEX ROWID| MV_INVENTORY_TRANSACTION_ARCH | 1 | 72 | 19269 (1)| 00:03:52 |
| 28 | INDEX RANGE SCAN | QUI_IDX_INVTRANS_ARC1 | 36016 | | 287 (1)| 00:00:04 |
| 29 | FILTER | | | | | |
| 30 | MAT_VIEW ACCESS BY INDEX ROWID| MV_INVENTORY_TRANSACTION_ARCH | 575 | 55200 | 293K (1)| 00:58:47 |
| 31 | INDEX RANGE SCAN | QUI_IDX_INVTRANS_ARC1 | 367K| | 3466 (1)| 00:00:42 |
| 32 | VIEW | MV_SKU | 37 | 3626 | 2 (0)| 00:00:01 |
| 33 | UNION-ALL PARTITION | | | | | |
| 34 | MAT_VIEW ACCESS BY INDEX ROWID | MV_SKU | 1 | 34 | 3 (0)| 00:00:01 |
| 35 | INDEX UNIQUE SCAN | PK_SKU | 1 | | 2 (0)| 00:00:01 |
| 36 | MAT_VIEW ACCESS BY INDEX ROWID | MV_SKU | 1 | 46 | 2 (0)| 00:00:01 |
| 37 | INDEX UNIQUE SCAN | PK_SKU | 1 | | 1 (0)| 00:00:01 |
------------------------------------------------------------------------------------------------------------------------So ,after checking the recommended plan I tried to execute the query with the hints,even then it is picking up the indexes in the explain plan.So please kindly help in solving the issue
The pk_sku is the index created on client_id and sku_id columns
Thanks
GVriedelme wrote:
My experience is differernt - hints will be followed if the optimizer determines they will be beneficial and not if they will not, including my current project on 11gR2. The example below (unfortunately only 11gR1) disproves your theory, showing the index hint is followed and that the cost increases by a factor of five.
The most common cases of the optimizer apparently ignoring a hint are due to operator error, the hint is not well formed, or cannot be followed. There are a couple of documented cases where a hint will be ignored - first_rows used in CTAS is one.
Jonathan Lewis writes a lot about it on his blog showing that the optimizer always acts on a well formed hint if it is at all possible.
SQL> create table t (n number not null, c varchar2(1000));
Table created.
SQL> insert into t select 1, rpad('x',1000,'x')
2 from dual connect by level <= 50000;
50000 rows created.
SQL> create index t_ix on t (n);
Index created.
SQL> exec dbms_stats.gather_table_stats(user, 't', cascade => true)
PL/SQL procedure successfully completed.
SQL> explain plan for
2 select max(c) from t where n =1;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 2966233522
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 1004 | 1574 (1)| 00:00:19 |
| 1 | SORT AGGREGATE | | 1 | 1004 | | |
|* 2 | TABLE ACCESS FULL| T | 50000 | 47M| 1574 (1)| 00:00:19 |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
2 - filter("N"=1)
14 rows selected.
SQL> explain plan for
2 select /*+ index (t t_ix) */ max(c) from t where n = 1;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 3231292748
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 1004 | 7244 (1)| 00:01:27 |
| 1 | SORT AGGREGATE | | 1 | 1004 | | |
| 2 | TABLE ACCESS BY INDEX ROWID| T | 50000 | 47M| 7244 (1)| 00:01:27 |
|* 3 | INDEX RANGE SCAN | T_IX | 50000 | | 98 (0)| 00:00:02 |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
3 - access("N"=1)
15 rows selected. -
I have a serious issue with my iTune store, its not down loading even after resetting the password!!! can someone help me to fix this problem..
What password did you change? Your Apple ID password? If you changed that, did you go to:
Settings > iTunes and App Store
Tap on Apple ID
Sign Out
Sign Back In with correct Apple ID and Password -
Trying to create my courses using Adobe Captivate, but even after saving the files as a pdf it will not upload in Udemy. What can I do?
Yep, you lose all interactivity when publishing to video.
Udemy, Lynda.com, Total Training and other similar models are based on simple "watch the video to learn" type of consumption. The only real interactivity you get is an ability to pause, rewind, fast forward. Basically anything you can do with a video.
Cheers... Rick -
I am trying to open iPhoto 9.3.2 on my iMac with OSX 10.7.4 and even after downloading the iPhoto upgrader it still will not open. Any suggestions.
Resetting Printing System helps OS X recognize new printers.
http://support.apple.com/kb/HT1341
When you add the printer, make sure you use IP > Jetdirect and the correct printer IP address. -
Okay, so I recently got all the products I wanted from CC via the student subscription. It was a bit of a pain getting everything working, as windows explorer crashed and reopened during installation of CC and during an update. Once I finally got in and got everything installed, I thought I was golden, it was then that I discovered my troubles had only just begun. Whenever I tried to open a program it either closed almost immediately after Startup or closed after giving the message "Could not validate license". Thus far I have not found a solution, as the much touted log out and log in method failed me.
Any help in this area would be greatly appreciated as I am honestly at a loss on what to do.
Technical details:
The programs I tried were After Effects, Audition, Photoshop and Premiere.
I am using Windows 7.Link for Download & Install & Setup & Activation problems may help
-Online Chat http://www.adobe.com/support/download-install/supportinfo/
Maybe you are looking for
-
Is there any way to stop the output of the iMac display to a connected TV?
I just bought an iMac 21.5 and successfully connected it to my plasma HDTV using a Mini Displayport to HDMI adaptor and HDMI cables. Ideally, I would like to have the HDTV set up as a second display for watching movies, rather than mirroring the two
-
I have a compatibility problem with Reader 9. I have designed a PDF with Adobe LiveCycle Designer ES 8.1. and a button, the JS code: app.execMenuItem("SaveAs"); But if I use Reader 9, get the error message: "The document could not be saved. There was
-
DHCP failed to give me an IP and OS X set my date to 2001/01/01
Worked on my mbp for about 4 hours. Shutdown and came back home. No new software, update or whatever. Just synch'ed iPhone, Last.fm, Mail.app and some browsing. Turn it on and login. I'm asked to join a network (my wifi network that is the 1st one on
-
TS1382 ipod will play music but the screen is blank
The ipod will play music but I can not see the screen. It remains blank.
-
How to get an environment variable from OS in class ?
Hello, How to get an environment variable from OS in class ? Thanks !