简体   繁体   English

从Oracle的Progress数据服务器中停止与索引相关的提示和子句

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

I am using progress data server for oracle. 我正在为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. 实际的数据库驻留在ORACLE 11g上,并且仅使用oracle DB模式创建进度模式,并使用ora-brokers连接Oracle DB。 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. 我们希望Oracle根据执行计划来处理索引选择,因此我们为Data Server添加了-noindexhint参数,它停止了查询的索引提示,而这些查询是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). 现在的问题是,即使没有索引提示,数据服务器也会使用与where子句列及其顺序匹配的索引向SQL查询添加order by子句(即使在进度查询中未使用by子句)。 Because of this order by coming from Data server, Oracle is forced to use different index which is taking much time. 由于来自数据服务器的此顺序,Oracle被迫使用其他索引,这会花费很多时间。 One solution here seems removing all indexes from Schema holder as in source code we are not using any explicit use-index keyword. 这里的一种解决方案似乎是从Schema持有者中删除所有索引,因为在源代码中我们没有使用任何显式的use-index关键字。 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. 之所以要添加order by,是因为Progress试图维持与代码针对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). 意思是,如果您使用的是FIND FIRST(例如),则有一个特定的含义是FIRST记录,而不仅仅是随机记录(除非您指定order by,否则Oracle一样)。

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. 通常,但并非总是如此,当我遇到这些问题时,我发现列的统计信息不够详细,无法知道有多少记录要返回,并且/或者没有正确设置与排序/ IO相关的参数。 This causes the CBO to make bad decisions and choose an index path instead of sorting the usually small subset returned. 这会导致CBO做出错误的决定并选择索引路径,而不是对通常返回的较小子集进行排序。

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. 我将首先检查这些内容,并确保您具有适当数量的直方图或切换到SKEW,然后再开始与模式持有人混淆。

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. 从模式持有者中删除索引将是有问题的,因为这将影响Progress如何看待表与表的唯一性之间的关系。

You do have a few code related options as well: 您的确有一些与代码相关的选项:

  1. Run a stored procedure instead of using FOR/FIND. 运行存储过程,而不使用FOR / FIND。
  2. Run pass through SQL instead of using FOR/FIND. 通过SQL运行传递而不是使用FOR / FIND。
  3. Add indexes on the Oracle side that match the sort specified 在Oracle端添加与指定排序匹配的索引

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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