简体   繁体   中英

Stopping index related hints and clauses from Progress data server for oracle

I am using progress data server for oracle. Actual DB resides on ORACLE 11g and only progress schema is created with oracle DB schema and used to connect Oracle DB using ora-brokers. We want Oracle to handle index selection as per execution plan, so we added -noindexhint parameter for Data Server and it stopped index hints from queries which are hitting to Oracle. Now issue is even if there is no index hint, Data server is adding order by clause to SQL query using indexes matching where clause columns and their sequence.(even if by clause in not used in progress query). Because of this order by coming from Data server, Oracle is forced to use different index which is taking much time. One solution here seems removing all indexes from Schema holder as in source code we are not using any explicit use-index keyword. Kindly provide your comments for handling this case.

You should not prevent attempt to globally prevent the order by and I am fairly sure that you cannot do this with a switch.

The reason the order by is being added is because Progress is trying to maintain the same behavior as if the code was running against a Progress DB. Meaning if you are using FIND FIRST (for an example) there is a specific meaning to which is the FIRST record and not just a random record (like Oracle does unless you specify order by).

In general (but not always) when I have these problems I find that the statistics for the columns aren't detailed enough to know how many records are coming back and/or the sorting/IO related parameters aren't set properly. This causes the CBO to make bad decisions and choose an index path instead of sorting the usually small subset returned.

I would check those out first and make sure you have the appropriate number of histograms or switch to SKEW before you start messing with the schema holder.

Removing the indexes from the schema holder will be problematic because it will impact how Progress sees the relationships between the tables and the uniqueness of the tables.

You do have a few code related options as well:

  1. Run a stored procedure instead of using FOR/FIND.
  2. Run pass through SQL instead of using FOR/FIND.
  3. Add indexes on the Oracle side that match the sort specified

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM