Page 1 of 1

dotconnect Index Hints

Posted: Wed 19 Nov 2014 10:45
by StefanAim
In the article
http://blog.devart.com/using-oracle-opt ... ework.html
is described how to use hints to force oracle to use an index.

I have following question: Devart uses table synonyms and the hint
only works, when I write it with the correct synonym but not when
I only use the table name.

E.g in the example:

ctx.Exployees.Where("Devart.Data.Oracle.HINTS('INDEX(employees index1)')")

it could be, that devart creates a synonym, depending on the linq query and I must use something like "MY_SYNONYM"

ctx.Exployees.Where("Devart.Data.Oracle.HINTS('INDEX(\"MY_SYNONYM\" index1)')")

It is not always easy to find out what is the synonym of the outer most select statement.
And I am not sure if always the same name is used.
What is your suggestion how I should handle this?

Re: dotconnect Index Hints

Posted: Fri 21 Nov 2014 16:25
by Shalex
Please check the generated SQL via dbMonitor (documentation, download link) to find out the synonym used in the result SQL so that you can use it in your LINQ query.

Re: dotconnect Index Hints

Posted: Fri 05 Dec 2014 07:23
by MariiaI
The Devart.Data.Oracle.Entity.INDEX_HINT function for specifying Oracle INDEX hint without the explicitly specified table's alias in EntitySQL is added.
The OracleFunctions.IndexHint method for specifying Oracle INDEX hint without the explicitly specified table's alias in LINQ to Entities is added.

New build of dotConnect for Oracle 8.4.303 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=30900.

Re: dotconnect Index Hints

Posted: Wed 11 Feb 2015 08:52
by Shalex
We have added the Using INDEX_HINT Function section to http://blog.devart.com/using-oracle-opt ... ework.html.