OpenERP数据导入问题

1. 性能低,比如产品导入1000多行,可能要半个小时,需要改进。


2. 导入一条失败,则整个失败。


3. many2one字段导入不友好,需要做转换,转换成xml_id。


4. 必填字段导入前需要做检查。


5. 导入可能需要手工校对栏位。


性能问题是瓶颈问题,性能低严重影响工作效率。

性能之所以低,原因是因为默认的导入(csv导入)用到了savepoint,当所有的transaction 都ok时,savepoint 才commit,否则roll back。


解决方案:

可以考虑用 autocommit来处理可能提升性能。

导入数据另行进行开发,需要用到xmlrpc, 最好使用单线程,因为数据库类在设计上,为了避免读取脏数据,采用了Serializable级别的,详见以下描述:


 One very important property of database transactions is the
        level of isolation between concurrent transactions.
        The SQL standard defines four levels of transaction isolation,
        ranging from the most strict *Serializable* level, to the least
        strict *Read Uncommitted* level. These levels are defined in
        terms of the phenomena that must not occur between concurrent
        transactions, such as *dirty read*, etc.
        In the context of a generic business data management software
        such as OpenERP, we need the best guarantees that no data
        corruption can ever be cause by simply running multiple
        transactions in parallel. Therefore, the preferred level would
        be the *serializable* level, which ensures that a set of
        transactions is guaranteed to produce the same effect as
        running them one at a time in some order.


因此,多线程容易引发并发事物,从而导致死锁,降低了性能。


此外,采用更高版本的postgresql数据库能有所优化。



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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值