rootbin

总是很懒,写不来博客,最近发现可以从onenote同步到博客园,虽然格式丑点,勉强算写博客了吧,可能以后都不干abap,权当纪念一下.
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

簇的概念

Posted on 2015-04-28 16:50  rootbin  阅读(1134)  评论(0)    收藏  举报

: 简单的说就是更具相同的特征 合并数据

簇表

来自多张table  具有相同key的记录合并成一条记录  放在簇表里

   

 簇表的存储空间在表簇

   

这个是SAPbsegdemo

当然我们也可以自定义

原理的话见 cluster table  这篇文章

   

簇数据库

当然原理上是有类似的

但不能和这里的簇表和表簇相混淆

簇数据库 只是利用这个特性 不同Object的数据保存到一张table

同时簇数据库还有其特有的export写入方式

其操作过程也体现簇的分类方式   

   

   

簇表

2014年4月6日

23:03

   

Table pools (pools) and table clusters (clusters) are special table types in the ABAP Dictionary. The data from several different tables can be stored together in a table pool or table cluster. Tables assigned to a table pool or table cluster are referred to as pooled tables or cluster tables.

oracle中关于簇表的描述:

    簇其实就是一组表,是一组共享相同数据块的多个表组成。 将经常一起使用的表组合在一起成簇可以提高处理效率。

    在一个簇中的表就叫做簇表。建立顺序是:簇表数据簇索引

特点就是数据存储在一个"block"

每条记录除了key fields之外 其他数据字段一起打包在一起

cluster pooled的概念差不多 在存储上有区别

   

You need the structural information stored in the ABAP Dictionary to read the data from a pooled table or cluster table correctly. These tables can therefore only be processed using Open SQL with the cluster interface, and not with Native SQL directly in the database.

个人理解:

sap使用簇表由于表实在太多

逻辑关系过于复杂

查询不便 集中到一个cluster/pool中利于管理

同时带来view更高的效率

现在还有一个疑问:数据更新是否会把变化同步到cluster 

个人认为是会的 就像index同步变化一样

据有些人的解释 vardata中存储的甚至是"指针" 这也是可以理解的

table pool存储pool table,pool talbe都是些数据量不大的表

事实上pool中存在大量的pool table

据说是为了减少集中访问这些表时资源的消耗

现在只需对pool分配资源并进行操作  (pool talbe都是小表 没必要不断的分配资源查找  也是有道理的)

所以一些配置信息都是存储在pool table中的

table cluster相反 存储数据量很大的表

关键在于 cluster table 都有相同的key field

相同的key field组成一条记录  显然也是为了节省空间 提高查询效率

bseg为例

某个客户的一个已清凭证 可能从bseg查得出 1条数据

但是它包含了我们所需的所有信息

例如需要从 bsas 1 bsak 1 各取一条信息合并的结果

通过bseg簇表直接就获取了所有的信息

减少io 提高效率

ps:二级索引的自我解释

一般主索引就是我们定义的tablekey fields

二级索引就是自定义的索引 

但是这里是一张table

但是这张table的功能来充当索引表

所以称为xxx的次级索引

   

自定义簇表

2015年1月12日

15:57

赋值 indx

其他字段的赋值 使用from

   

REPORT  YINDX.

   

parameters:

  r1 radiobutton group g1,

  r2 radiobutton group g1.

   

start-of-selection.

  databegin of lt_demo occurs 0,

          name(4),

          datum type sy-datum,

        end of lt_demo,

        ls_zindx type zindx.

   

  ls_zindx-uname sy-uname.

   

  if r1 'X'.

    do times.

      lt_demo-name sy-index.

      lt_demo-datum sy-index + sy-datum.

      append lt_demo.

    enddo.

   

    export t1 lt_demo[] to database zindx(lb)

    from ls_zindx

    id 'QWERT'.

  else.

    import t1 lt_demo[] from database

    zindx(lbid 'QWERT'.

    datal_str type string.

    loop at lt_demo.

      l_str lt_demo+0.

      write / l_str.

    endloop.

  endif.



亲爱的P.I.G 你应该是不会到这里来的吧 ? I'm always 怀挺!