apoc.warmup.run

在 APOC 2025.06 版本中,由于以下原因,此过程已从 APOC 核心库中移除:

如果您使用的是 APOC 2025.06 或更高版本,该过程在 Cypher 25 中不可用,但仍可与 Cypher 5 一起使用。有关更多信息,请参阅 APOC 和 Cypher 版本

此过程不建议在多线程中运行,因此并行运行时(Parallel runtime)不支持该过程。有关更多信息,请参阅 Cypher 手册 → 并行运行时

详细信息

语法

apoc.warmup.run([ loadProperties, loadDynamicProperties, loadIndexes ]) :: (pageSize, totalTime, transactionWasTerminated, nodesPerPage, nodesTotal, nodePages, nodesTime, relsPerPage, relsTotal, relPages, relsTime, relGroupsPerPage, relGroupsTotal, relGroupPages, relGroupsTime, propertiesLoaded, dynamicPropertiesLoaded, propsPerPage, propRecordsTotal, propPages, propsTime, stringPropsPerPage, stringPropRecordsTotal, stringPropPages, stringPropsTime, arrayPropsPerPage, arrayPropRecordsTotal, arrayPropPages, arrayPropsTime, indexesLoaded, indexPages, indexTime)

描述

将数据库中的所有 NODE(节点)和 RELATIONSHIP(关系)值加载到内存中。

输入参数

名称

类型

描述

loadProperties

布尔值 (BOOLEAN)

loadProperties = false :: BOOLEAN 默认值为:false

loadDynamicProperties

布尔值 (BOOLEAN)

loadDynamicProperties = false :: BOOLEAN 默认值为:false

loadIndexes

布尔值 (BOOLEAN)

loadIndexes = false :: BOOLEAN 默认值为:false

返回参数

名称

类型

描述

pageSize

INTEGER(整数)

pageSize :: INTEGER

totalTime

INTEGER(整数)

totalTime :: INTEGER

transactionWasTerminated

布尔值 (BOOLEAN)

transactionWasTerminated :: BOOLEAN

nodesPerPage

INTEGER(整数)

nodesPerPage :: INTEGER

nodesTotal

INTEGER(整数)

nodesTotal :: INTEGER

nodePages

INTEGER(整数)

nodePages :: INTEGER

nodesTime

INTEGER(整数)

nodesTime :: INTEGER

relsPerPage

INTEGER(整数)

relsPerPage :: INTEGER

relsTotal

INTEGER(整数)

relsTotal :: INTEGER

relPages

INTEGER(整数)

relPages :: INTEGER

relsTime

INTEGER(整数)

relsTime :: INTEGER

relGroupsPerPage

INTEGER(整数)

relGroupsPerPage :: INTEGER

relGroupsTotal

INTEGER(整数)

relGroupsTotal :: INTEGER

relGroupPages

INTEGER(整数)

relGroupPages :: INTEGER

relGroupsTime

INTEGER(整数)

relGroupsTime :: INTEGER

propertiesLoaded

布尔值 (BOOLEAN)

propertiesLoaded :: BOOLEAN

dynamicPropertiesLoaded

布尔值 (BOOLEAN)

dynamicPropertiesLoaded :: BOOLEAN

propsPerPage

INTEGER(整数)

propsPerPage :: INTEGER

propRecordsTotal

INTEGER(整数)

propRecordsTotal :: INTEGER

propPages

INTEGER(整数)

propPages :: INTEGER

propsTime

INTEGER(整数)

propsTime :: INTEGER

stringPropsPerPage

INTEGER(整数)

stringPropsPerPage :: INTEGER

stringPropRecordsTotal

INTEGER(整数)

stringPropRecordsTotal :: INTEGER

stringPropPages

INTEGER(整数)

stringPropPages :: INTEGER

stringPropsTime

INTEGER(整数)

stringPropsTime :: INTEGER

arrayPropsPerPage

INTEGER(整数)

arrayPropsPerPage :: INTEGER

arrayPropRecordsTotal

INTEGER(整数)

arrayPropRecordsTotal :: INTEGER

arrayPropPages

INTEGER(整数)

arrayPropPages :: INTEGER

arrayPropsTime

INTEGER(整数)

arrayPropsTime :: INTEGER

indexesLoaded

布尔值 (BOOLEAN)

indexesLoaded :: BOOLEAN

indexPages

INTEGER(整数)

indexPages :: INTEGER

indexTime

INTEGER(整数)

indexTime :: INTEGER

使用示例

本节中的示例基于以下示例图

MERGE (michael:Person {name: "Michael"})
WITH michael
CALL {
    WITH michael
    UNWIND range(0, 10000) AS id
    MERGE (p:Person {name: "Person" + id})
    MERGE (michael)-[:KNOWS]-(p)
    RETURN count(*) AS friends
}
RETURN friends;
结果
friends

10001

CALL apoc.warmup.run()
YIELD nodesTotal, nodePages, relsTotal, relPages, propPages, propertiesLoaded
RETURN nodesTotal, nodePages, relsTotal, relPages, propPages, propertiesLoaded;
结果
nodesTotal nodePages relsTotal relPages propPages propertiesLoaded

10002

184

10001

417

503

FALSE

CALL apoc.warmup.run(true, true, false)
YIELD nodesTotal, nodePages, relsTotal, relPages, propPages, propertiesLoaded
RETURN nodesTotal, nodePages, relsTotal, relPages, propPages, propertiesLoaded;
结果
nodesTotal nodePages relsTotal relPages propPages propertiesLoaded

10002

184

10001

417

503

TRUE

此过程仅适用于数据库记录格式为 standardalignedhigh_limit 的情况。记录格式通过 Neo4j 配置文件中的 db.format 设置进行配置。