BaseX - 在 XQuery 中使用封闭 xml 时内存不足 [英] BaseX - Out of memory when using enclosing xml in XQuery

查看:37
本文介绍了BaseX - 在 XQuery 中使用封闭 xml 时内存不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试查询包含超过 1500000 个项目的 BaseX 数据库.当我运行此查询时

I've been trying to query a BaseX db which contains more than 1500000 items. When i run this query

for $item in collection('coll')//item
    return $item (: returns an xml element :)

它在不到一秒的时间内执行.

it executes in less than a second.

但是当我尝试在 xml 中返回结果时,我收到主内存不足"错误.

But when i try to return the result in an xml I get an "Out of main memory" error.

<xml>{
    for $item in collection('coll')//item
       return $item
}</xml>

这让我想放弃原生的 xml db 方法(其他数据库也一样,例如 eXistDB),所以如果有人知道这个问题的任何信息,那将非常有帮助.

This is something that makes me want to abandon the native xml db approach (same happens with other DBs, such as eXistDB), so if anyone has any info this problem, it would be extremely helpful.

谢谢

推荐答案

使用 BaseX 9.0,您可以通过 COPYNODE 选项:

With BaseX 9.0, you can temporarily disable node copying via the COPYNODE option:

(# db:copynode false #) {
  <xml>{
    for $item in collection('coll')//item
    return $item
  }</xml>
}

这篇关于BaseX - 在 XQuery 中使用封闭 xml 时内存不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆