Documentum/DQL: Default sort order in search results of dql

If I ran a select DQL statement and there is no ORDER BY clause included, what is the default sort order for basic search?

Trace the query in the database - if there is no order by then the database is free to return the records in any order it wants, the actual order will be driven by query plans and the order in which data is stored in the blocks.
If you wish your data to be returned in a particular order you must include an ORDER BY clause.


Another EMC Solution for reference:
Default sorting of search results in TaskSpace

Symptoms

Two consecutive executions of a Search query return sets with different order of results


Cause

In the DB side, the retrieved data is not displayed in a mere random order. If unsorted, data will typically be displayed in the order in which it appears in the underlying tables. This could be the order in which the data was added to the tables initially.
But, if data was subsequently updated or deleted, the order will be affected by how the DBMS reuses reclaimed storage space. The end result is that you cannot (and should not) rely on the sort order if you do not explicitly control it. Relational database design theory states that the sequence of retrieved data cannot be assumed to have significance if ordering was not explicitly specified.

Resolution

In order to control sorting of the Search results, a dql query used in a Search template should be modified by adding an ORDER BY statement (i.e. ORDER BY r_object_id). It will explicitly set the sorting of the result set and help to avoid inconsistent sorting of consecutive results.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值