Documentum 应用程序中长时间运行的查询

发布于 2024-12-03 08:52:09 字数 828 浏览 1 评论 0原文

在 Documentum 应用程序中检索对象时,需要很长时间。我们在数据源 och 中激活了长时间运行查询选项,但发现以下查询花费了太多时间:

select all 
  b.r_object_id, dm_repeating1_0.state_name, a.object_name 
from 
  dm_policy_sp  a, 
  dm_sysobject_sp  b, 
  dm_policy_rp dm_repeating1_0 
where 
    (
      (a.r_object_id=b.r_policy_id) 
      and (dm_repeating1_0.i_state_no=b.r_current_state) 
      and b.r_object_id in (N'a long, long list of IDs') 
      or a.r_object_id in (N'a long, long list of IDs')
    ) 
    and /* ...  */

如您所见,表“a”是一个策略表,它只有 7 条记录。在两个“or”运算符后面的 SQL 语句中,我们正在查找表“a”中 100 个对象之间的 object_id!我们执行查询并在表“b”(systemObjects) 中搜索这些对象,我们发现这些对象属于表 b!

上述查询大约需要17分钟。当我们将表中“或”运算符后面的表名改为b时,只用了10秒!

我们认为这个查询是错误的。我们不知道这是 Documentum 中的错误还是我们配置了 Documentum 错误。我们不知道在哪里可以找到创建此 SQL 的 DQL 或相关组件?有什么想法吗?

When retrieving objects in our Documentum application it takes a long time. We have activated long running query option in data source och, but have found that the below query is taking too much time:

select all 
  b.r_object_id, dm_repeating1_0.state_name, a.object_name 
from 
  dm_policy_sp  a, 
  dm_sysobject_sp  b, 
  dm_policy_rp dm_repeating1_0 
where 
    (
      (a.r_object_id=b.r_policy_id) 
      and (dm_repeating1_0.i_state_no=b.r_current_state) 
      and b.r_object_id in (N'a long, long list of IDs') 
      or a.r_object_id in (N'a long, long list of IDs')
    ) 
    and /* ...  */

As you can see, the table "a" is a policy table and it has only 7 records. In the SQL statement after both "or" operators, we are looking for an object_id between 100 objects in table "a"! We executed a query and searched for those objects in table "b" (systemObjects) and we found that those objects belong to table b!

The above query takes about 17 minutes. When we changed the name of table after "or" operator in table to b, it took only 10 seconds!

We suppose this query is wrong. We don't know if it is a bug in Documentum or we have configured Documentum wrong. We don't know where we can find the DQL which creates this SQL or related components? Any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

骑趴 2024-12-10 08:52:09

看起来 documentum 在 LifecycleNameDataHandler 和 LifecycleDataHandlerHelper 中执行此操作。我反编译这些类,发现这个 DQL 查询

SELECT b.r_object_id, a.state_name, a.object_name FROM dm_policy(all) a, dm_sysobject(all) b WHERE b.r_object_id IN (...) AND a.r_object_id = b。 r_policy_id AND a.i_state_no = b.r_current_state ENABLE(row_based)

Documentum Webtop 执行此命令当用户打开任何具有生命周期状态名称列的数据网格时进行 DQL 查询。

有几个选项:

  1. 在数据库级别优化查询并从 DQL 进行测试(DA 中的 dql Tester 等)
  2. 反编译类 LifecycleDataHandlerHelper 并以其他方式重写 DQL 查询。尝试添加诸如 FORCE_ORDER 之类的提示或其他内容。
  3. 如果您根本不使用生命周期,您可以轻松禁用此类。在文件 webcomponent\app.xml 行 com.documentum.webcomponent.library.applylifecycle.LifecycleNameDataHandler 应被注释或禁用。
  4. 从网格中删除生命周期状态名称(或状态名称)。也许用户在他们的自定义网格中选择此列。可以建议用户从网格中删除此列。

Looks like documentum does it inside LifecycleNameDataHandler and LifecycleDataHandlerHelper. I decompile these classes and found this DQL query

SELECT b.r_object_id, a.state_name, a.object_name FROM dm_policy(all) a, dm_sysobject(all) b WHERE b.r_object_id IN (...) AND a.r_object_id = b.r_policy_id AND a.i_state_no = b.r_current_state ENABLE(row_based)

Documentum Webtop execute this DQL query when user open any datagrid with LifeCycle state name column.

There are a few option:

  1. Optimize query on database level and test it from DQL (dql Tester in DA and etc)
  2. Decompile class LifecycleDataHandlerHelper and rewrite DQL query in other manner. Try to add hints like FORCE_ORDER or something else.
  3. If you do not use Life Cycles at all, you can easy disable this class. in the file webcomponent\app.xml line com.documentum.webcomponent.library.applylifecycle.LifecycleNameDataHandler should be commented or disabled.
  4. Delete Life Cycle State name (or State Name) from grids. Maybe users select this column in their customized grids. It is possible to advice users to delete this columns from the grids.
凉月流沐 2024-12-10 08:52:09

我不知道您到底想通过此查询检索什么,但我认为您的查询可能会被修改如下:

select all 
  b.r_object_id, dm_repeating1_0.state_name, a.object_name 
from 
  dm_policy_sp  a, 
  dm_sysobject_sp  b, 
  dm_policy_rp dm_repeating1_0 
where 
    (
      (a.r_object_id=b.r_policy_id) 
       AND dm_repeating1_0.r_object_id=a.r_object_id
      and (dm_repeating1_0.i_state_no=b.r_current_state) 
      and (b.r_object_id in (...) 
      or a.r_object_id in (...))
    ) 

I don't know what exactly you want to retrieve by this query, but I think that your query might be reworked as follows:

select all 
  b.r_object_id, dm_repeating1_0.state_name, a.object_name 
from 
  dm_policy_sp  a, 
  dm_sysobject_sp  b, 
  dm_policy_rp dm_repeating1_0 
where 
    (
      (a.r_object_id=b.r_policy_id) 
       AND dm_repeating1_0.r_object_id=a.r_object_id
      and (dm_repeating1_0.i_state_no=b.r_current_state) 
      and (b.r_object_id in (...) 
      or a.r_object_id in (...))
    ) 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文