How do i use HINT
I tried to google but didn't find any good simple example of HINT.
Can you guys give me a simple example on using HINT? Do i need to activate something in oracle to use it?
Cheers.
The first hint on HINT usage should be not use HINT.
Then, what about Oracle online documentation search instead of googling :
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements006.htm#SQLRF00219
Nicolas.
Similar Messages
-
How to use hints in Obiee to increase performance
Anybody please tell me how can we use hints to increase performance of ad hoc and dashboard reports in obiee
Hi,
Check this,
http://www.howtoexam.com/index.php?option=com_content&view=article&id=75%3Ausing-hints-in-obiee-rpd-and-answers&catid=790%3Acomputers-and-software&Itemid=166
Rgds,
Dpka -
How do I use Sql hints in PreparedStatement?
Hi,
I am trying to use a sql query which uses Oracle hints to optimize the query. I am using the ojdbc drivers from Oracle. I am using the PreparedStatement (Java 1.4) to execute this query, but it returns an empty resultset. If I remove the hint, then the query works fine using the PreparedStatement. Does anyone know how to make sql hints work using preparedstatement. I tried it with Statement object and that works (ie. the hint works and returns rows as expected).
The query is as follows:
select /*+ ordered
use_nl(ri ma)
count(*),
ma.columnName
from table1 ri,
table2 ma
where ma.columnName2 = ri.columnName2
and ma.column3 = 1
and ri.column4 = 66
group by ma.columnName
I tried escaping the /*+ but that also didn't work. Any help would be appreciated.
Thanks in advance,
ParagMust be an old database.
Presumably you tried it in sqlplus and it worked both ways. If not then nothing you do will make it work in java.
Other than that my quess would be that it has nothing to do with the select.
Some possibilities.
1. You are eating exceptions.
2. You are not running the code that you think you are. -
How to compile the hint to force selection statement to use index
Hello expert,
will you please tell me how to compile the hint to force selection statement to use index?
Many Thanks,Not sure what you mean by compile, but hint is enclosed in /*+ hint */. Index hint is INDEX(table_name,index_name). For example:
SQL> explain plan for
2 select * from emp
3 /
Explained.
SQL> @?\rdbms\admin\utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 3956160932
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 14 | 546 | 3 (0)| 00:00:01 |
| 1 | TABLE ACCESS FULL| EMP | 14 | 546 | 3 (0)| 00:00:01 |
8 rows selected.
SQL> explain plan for
2 select /*+ index(emp,pk_emp) */ *
3 from emp
4 /
Explained.
SQL> @?\rdbms\admin\utlxpls
PLAN_TABLE_OUTPUT
Plan hash value: 4170700152
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 14 | 546 | 2 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| EMP | 14 | 546 | 2 (0)| 00:00:01 |
| 2 | INDEX FULL SCAN | PK_EMP | 14 | | 1 (0)| 00:00:01 |
9 rows selected.
SQL> Hint in the above example is forcing optimizer to use index which resul;ts in a bad execution plan. Most of the time optimizer does not need hints and chooses an optimal plan. In most cases sub-optimal plan is result of stale or incomplete statistics.
SY. -
How to use hints in PL/SQL
Hi,
If I want to use hints in PL/SQL procedure, it is valid to write it this way:
begin
update /*+ INDEX(opp DIM_OPP_REFDB_IDX) */
scott.rec_dim_opportunity opp
set opp.mp_opportunity_re ....
endI doubt when I tried it that the optimizer didn't actually use the index.
Thanks in advance.
Oracle 10g R1
Windows 2003 32-bitthe table is of 90MB and when the UPDATE statement is used in SQL, the explain plan output shows that the index is used.
When I execute it from a procedure, the Current Statement show in TOAD doesn't show that the index is used and the update takes forever. Explain plan of the statement (as show in TOAD) shows that full table scan is being used. -
How to use hint on with clause query
Hi all,
I have a query and it consits full of tabs with WITH clause. Top level I am just selecting all the tabs (queries with WITH clause) by saying select * from tab1,tab2,.....so on .
Now my question is If I want to use hint on my SQL can I use the same by using tab1,tab2...
tab1, tab2 are not actually tables ....each tab represents one SQL with WITH clause.
Please let me know if there is any confusion on my post.What's stopping you from trying it yourself?
Post your results here to help others. -
How to include optimizer hints in Discoverer
We have a Discoverer report which used to run fine prior to DB migration from (9.2.0.6 to 10G Rac 10.2.0.4).
Since the database is migrated to 10g RAC same reports is running for longer time and failes with ROW_ID error,
we ran the sql generated by the report in SQL Plus with below optimizer hint.
Select /*+ optimizer_features_enable('9.2.0') */
this query ran well with optimizer hint, but i am wondering how to use the optimizer hint in Discoverer Plus/Desktop.
Select /*+ optimizer_features_enable('9.2.0') */
C.EMPLOYEE_NUMBER||' '||A.EMPLOYEE_NAME, A.REPORTS_TO, C.SERVICE_CODE, COUNT(B.ACCOUNT_NUMBER)
FROM PSTAGE.NEW_EMPLOYEE_MASTER A,
PSTAGE.NEW_ALL_WORK_ORDER_MASTER B,
PSTAGE.NEW_ALL_WORK_ORDER_DETAIL C
WHERE ( ( B.WORK_ORDER_NUMBER = C.WORK_ORDER_NUMBER AND B.SITE_ID = C.SITE_ID )
AND ( A.EMPLOYEE_NUMBER = C.EMPLOYEE_NUMBER AND A.SITE_ID = C.SITE_ID ) )
AND ( B.WO_STATUS <> 'CN' )
AND ( C.EMPLOYEE_NUMBER = ANY(SELECT S254_200018.EMPLOYEE_NUMBER
FROM PSTAGE.NEW_EMPLOYEE_MASTER S254_199317,
PSTAGE.NEW_ALL_WORK_ORDER_MASTER S254_199854,
PSTAGE.NEW_ALL_WORK_O
Thanks in advanceHi Sunil
In the Administrator tool, you can add hints to the driving folder used in your query. A first glance at your report seems to indicate that B might be the driver.
If you launch the Administrator tool, open the business area then right-click on the folder in question you can select Properties. The second to last property is called Optimizer hints. Try setting the same hint in here exactly the way you would do it inside SQL.
I am not 100% sure whether this would take as this isn't a folder hint per se, but it is worth a try. You might also want to look at this thread: how to design Optimizer hints to the generated SQL
Another thing to check is to look at the code that is being generated by your Discoverer worksheets. Do you by chance see a NOREWRITE hint being added? This is a common issue with newer systems. This hint tells the database that the query cannot be rewritten which in most cases will cause poor performance. If this is happening to you I advise you to disable that hint. This is done by editing the pref.txt and adding a new preference called
Out of the box, Discoverer Plus will sometimes add the NOREWRITE hint. This will cause Plus worksheets to operate much slower than Desktop worksheets. You can disable the NOREWRITE hint by adding a new preference called UseNoRewriteHint to pref.txt in the Database section. After you have done this you will have to run the apply preferences script.
[Database]
UseNoRewriteHint = 0
Be sure to close all of your IE windows so that a new JVM is loaded.
For example, you might turn on UseNoRewriteHint (i.e. set it to 1) if you want users to always query against the latest data (e.g. created today), even though this might be slower than querying the summary data (e.g. created yesterday). The NOREWRITE hint instructs the optimizer to disable query rewrite for the query block, which overrides the setting of the parameter QUERY_REWRITE_ENABLED.
Default Value: 0
Valid Values
0 = Do not add the NOREWRITE hint. This is the one I recommend.
1 = Do add the NOREWRITE hint.
Another possible area is with query prediction. This is taken from an Oracle Note: Under some circumstance when you run a query against an Oracle 10g database, the queryprediction might take up the majority of time and CPU may hit 100%.
The cause for this is an an Oracle10g (10.1) database issue but seeing as you are on 10.2 this might not be an issue any more. I throw it out there just in case you still hvae issues and want to raise this with Oracle. The last I heard is that the root cause was still under investigation in an unpublished Bug:4024370. There was a workaround to the issue:
1. Disable Query Prediction (strongly recommended anyway):
For Plus/Viewer:
Edit pref.txt on the middle-tier server and set QPPEnable=0
Run the applypreferences script (.sh or .bat)
For Desktop:
Edit the registry and set QPPEnable=0
HKEY_CURRENT_USERS\Software\ORACLE\Discoverer <version>\Database
2. If you still wish to use Query Prediction while the database issue is being investigate, then you can configure the Query Predictor to use the Explain Plan method rather than the Dynamic Views method.
For Plus/Viewer:
Edit pref.txt on the middle-tier server and set QPPObtainCostMethod=0
Run the applypreferences script (.sh or .bat)
For Desktop:
Edit the registry and set QPPObtainCostMethod=0
HKEY_CURRENT_USERS\Software\ORACLE\Discoverer <version>\Database
Hope this helps
Best wishes
Michael -
How can I use the POST form in defining a SAMLCredentialMapperV2
Hi,
I am trying to configure the SAMLCredentialMapperV2 in our WebLogic Portal 10.3.2. There is a parameter called "POST form -
The POST form used with this SAML Relying Party". Can anyone give me a hint of how I can use this form parameter, where I have to deploy this form
and where can I find documentation about those parameters.
Any help would be appreciated.
Best Regards
EdmundAs far as i remember his parameter was optional
http://www.oracle.com/technology/pub/articles/dev2arch/2006/12/sso-with-saml.html is probably a better article, dont know if has any updates since this was written for 9.2 -
What is the disadvantage of using hints in query
hi all,
i am report developer, in my project we were using hits in the query ... so that the query performance has improved ..
my question is if we use hints in the query will it give any effects.. means to say instead of using hints we can make use of execution plan..
what is the use of execution plan i don't know.. but i have an ideal about it .. if we change the execution plan then that will be use full i think
please reply me,, if am wrong please correct me.. am not that much good at execution plan and hints in oracle..
please tel me the difference between hints and execution plan and which one is better ?
Thanks
RajaHint are used to bias the execution plan of a query. So there is no 'which is bettter'. Hints may be used to generate a different execution plan, but you can't predict how an execution plan looks like in the end. This decision is done by the db engine.
It best to start without any hints and let the query optimizer do the work. For queries you feel run to slow you can try to give hints and see if your assumption is correct (when the execution time is faster with hints).
On the other side your question is not related to jdev. You may ask the question in the {forum:id=75} forum
Timo -
How to create a hint for a component(awt),thanks
How to create a hint for a component(awt),the component of awt has not the property.
If you are talking about a tooltip, this is going to be hard.
You are probably going to have to use a mouseMotionListener to get the event that the mouse is over the component and then a Timer to fire the showTooltip event if the mouse hasn't moved in some amount of time. -
Tuning query without using hint
Hi,
i want to change the plan of a query without using hint.
Also i want to use the plan that hint generate in my original query.
My db is a 11g.
How can i do this?
tnxYou can use SQL Plan Manager. You might find this interesting:
http://blogs.oracle.com/optimizer/entry/what_should_i_do_with_old_hints_in_my_workload
The link above basically suggests these steps:
1. Run the query with the hints, then
2. Take the plan from #1 and associate its SQL plan baseline with the query with no hints
3. Remove the hints for that query in the code and start capturing and evolving plans for the un-hinted query -
Using hints to improve performance
Hi I am trying to create table using the below stmt. I am giving the counts on the tables also.
It is taking 5-6 minutes to create the table. I am trying to improve its performance.
Are my hints correct? What is nested look?
Any suggestions.
Thanks.
create table dt_25_temp as
select /*+ index(dt,DT_25_IDX) index(cl, T_CL_CLIENT_ID_CL_ID_IDX1 ) index(ml,T_MAILING_IDX2) index (ms ,t_ms_pk) use_nl(dupe,master)*/
dt.id ,dt.l_id , dt.cl_id
, ml.ml_id
, ml.ml_u3
, ms.t_cd
, ml.ml_u1
, ml.ml_u2
, ml.ml_u4
, ml.ml_u5
from Dt_25 dt
, t_ml ml
, t_cl cl
, t_ms ms
where dt.cl_id = cl.id
and cl.ml_id = ml.id
and dt.ms_id = ms.id
and cl.client_id = 12345
and ml.client_id = 12345
select count(1) from t_cl--1576262 records
select count(1) from t_ml--280682
select count(1) from t_ms--10341585
select count(1) from dt_25--1092469 ( this is temporary table I create daily , it mave have 1000 to 1M records )
DT_25_IDX is on column ID
T_CL_CLIENT_ID_CL_ID_IDX1 is on client_id and id
T_ML_IDX2 on id,cl_id
t_ms_pk is on column iduser10405034 wrote:
Hi I am trying to create table using the below stmt. I am giving the counts on the tables also.
It is taking 5-6 minutes to create the table. I am trying to improve its performance.
Are my hints correct? What is nested look?
Any suggestions.First of all, why are you using hints? If you have representative statistics in place and you're using the cost based optimizer it should be able to come up with a reasonable plan by itself. If not, you need to find out why. You should use hints only as a last resort, if you know something about your data that the optimizer simply doesn't know and therefore can't recognize.
I wonder why you use the USE_NL hint if you're asking what a "nested look" (I assume you meant NESTED LOOP) is, suggesting that you don't know what this particular hint is about?
- Can you show us the output of EXPLAIN PLAN using DBMS_XPLAN.DISPLAY? Use the \ tag before and after to use proper formatting in fixed font- What 4-digit version (e.g. 10.2.0.4) of Oracle are you using?
- Given the fact that your DT_25 table might have significantly different sizes, the question is if the data from the other tables joined to will be restricted by the join or not. It would be possible that if your DT_25 table is small, a index access into the other tables might be faster, whereas if your DT_25 table is large and covers a lot of data from the other tables, a full table scan of those tables might be more appropriate.
- How restrictive are these filter predicates specified:
and cl.client_id = 12345
and ml.client_id = 12345
i.e. how many rows from the totals provided correspond to those predicates?
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
How to specify rule hints in exp parfile query
Dear All,
How can I use EXP utility to export tha data whose query is following:
select /*+ INDEX(partlist, IDX_PSER)*/ item_number from partlist where class = 'C' ;
In my exp parfile i have the QUERY parameter that allows me to specify the where clause as follows:
where class = 'C' ;
However my concern is the hints rule part, which is autogenerated by exp. How can i specify the select hint(/*+ xxxx */
Pls advice.
Thanks,
MaheshHi,
In that case temporary create the table from the user which does not have tablespace resource issues. If all the user has tablespace issue, then I doubt you have any option except to use query clause in actual table.
Why you feel index hint would be more useful then full table scan in exp? i.e. records to be exported is very small(nearly 2 to 3%) compared to total records
Regards
Anurag Tibrewal. -
How to write SQL hints for this query?
The query is like:
select * from foo, t
where foo.name in
(select name from bar
where id in (
select id from car
where date < sysdate
and foo.a = t.b;
I want the innermostsubquery 'select id from car ...' to be executed first, and the subquery 'select name from bar ...' to be execute second, and the outermost query 'select * from foo,t ...' to be executed the last. How can I write the Oracle sql hints to force the order?
Thanks.user553560
You might be able to create a large set of hints to force the access path you want - but unless you really know what you are doing with hints, you may find that your solution is very unstable (it might be luck rather than correctness that let's it work to start with).
The difficulty in this query is the double layer of IN subqueries, so if you can rewrite the query, you might try manually unnesting as follows:
select
t1.*. t.*
from
select
distinct t2.name
from t2
where t2.id in (
select t3.id
from t3
where t3.dated < sysdate
) v,
t1,
t
where
t1.name = v.name
and t1.a = t.bDepending on your indexing and statistics, you may find that a simple /*+ unnest */ hint in the first subquery will be sufficient to do this for your. Again depending on the statistics you may find that you have to put extra hints into the above to make Oracle use the join method and indexes you think appropriate.
N.B. The first step (as others have noted) is to check that your statistics are good before you start manipulating the code or using hints.
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk -
How do I use Edge Web Fonts with Muse?
How do I use Edge Web Fonts with Muse - is it an update to load, a stand alone, how does it interface with Muse? I've updated to CC but have no info on this.
Hello,
Is there a reason why you want to use Edge Web Fonts with Adobe Muse?
Assuming you wish to improve typography of your web pages, you should know that Muse is fully integrated with Typekit. This allows you to access and apply over 500 web fonts from within Muse. Here's how you do it:
Select a text component within Muse, and click the Text drop-down.
Select Add Web Fonts option, to pop-open the Add Web Fonts dialog.
Browse and apply fonts per your design needs.
Muse also allows you to create paragraph styles that you can save and apply to chunks of text, a la InDesign. Watch this video for more information: http://tv.adobe.com/watch/muse-feature-tour/using-typekit-with-adobe-muse/
Also take a look at these help files to see if they help you:
http://helpx.adobe.com/muse/tutorials/typography-muse-part-1.html
http://helpx.adobe.com/muse/tutorials/typography-muse-part-2.html
http://helpx.adobe.com/muse/tutorials/typography-muse-part-3.html
Hope this helps!
Regards,
Suhas Yogin
Maybe you are looking for
-
Excise Invoice postings in J1IIN for Cess as Paper Cess
Dear All, Considering the aforsaid issue on priority. Issue is regarding the Export Sales Process. Pricing Procedure is not the same as normal exports. Here, in exports there is a component / duty which is termed as PAPER CESS (condition type JECP).
-
Using aperture from two different accounts and email notifications
Hi I have two issues. The first is that I have setup up two accounts on my iMac but I can't get both to use the same library. Both accounts have the exact same permissions and access. The second is that I get emails from this forum on every topic/not
-
Changing default values in Drop Shadow
When using Drop Shadow in the Motion tab of the viewer I find that I never have used the default settings of the Offset or the Opacity. Seems like there must be a way to change these settings permanently so they come up to some more convenient settin
-
how to downgrade app world from version 4.0.0.65 to 3.1.4.25 because my bb after upgrade to version 4.0.0.65 is gone... or how to show my app world ? thanks for help..
-
It's been 2 weeks since I spilled tea onto the keyboard of my MacBook Pro- now after plugging it in the sleep light lights up and beeps every 5 seconds but will not start up- it has been upside down and powered down since spill