dotconnect Index Hints

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
StefanAim
Posts: 9
Joined: Mon 02 Sep 2013 14:01

dotconnect Index Hints

Post by StefanAim » Wed 19 Nov 2014 10:45

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?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: dotconnect Index Hints

Post by Shalex » Fri 21 Nov 2014 16:25

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.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: dotconnect Index Hints

Post by MariiaI » Fri 05 Dec 2014 07:23

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: dotconnect Index Hints

Post by Shalex » Wed 11 Feb 2015 08:52

We have added the Using INDEX_HINT Function section to http://blog.devart.com/using-oracle-opt ... ework.html.

Post Reply