英文:
What are benefits of having custom Memgraph functions?
问题
MAGE提供了许多我可以在Memgraph中实现和运行的图算法。为什么和什么情况下会不够?如果我需要创建自己的函数,支持哪些编程语言?
英文:
With MAGE there is a lot of graph algorithms I can implement and run within Memgraph. Why and when would that not be sufficient? If I would need to create my own function which programing languages are supported?
答案1
得分: 1
标题回答:
在两种情况下建议编写供(任何)数据库引擎使用的过程:
- 当使用它将显著加快操作速度时。
- 当您有多个客户端(特别是使用不同语言)并且需要确保操作相同。
使用您喜欢的编程语言编写代码更快 - 这是事实。通常,这不是最优的开发解决方案,但却是最经济实惠的选择。
正文回答:
当MAGE的开发人员尚未提出解决您特定问题的想法时,请编写您的过程。
支持所有可以编译为ELF的语言。
英文:
Answer for title:
Writing procedures for use by (any) database engine is recommended in 2 cases:
- When using it will significantly speed up the operation.
- When you have several clients (especially in different languages) and you need to ensure that the operations are the same.
Writing code in your favorite language is faster - it's a fact. This is usually not the most optimal development solution, but the most economically viable.
Answer for body
Write your procedure when the developers of MAGE have not come up with an idea to solve your specific problem.
All languages that can be compiled to ELF are supported.
答案2
得分: 0
Memgraph具有加载用C/C++或Python编写的自定义函数的能力。然后,可以从任何Cypher表达式中调用这些自定义函数。从语义上讲,函数应该是功能的小片段,不需要长时间的计算和大内存消耗。有一个限制:函数的唯一要求是不修改图。
Memgraph MAGE作为MAGE项目的一部分具有许多预定义的函数。除了MAGE的现成函数之外,您还可以优化性能,例如,预编译的C++函数可以大幅提高筛选表达式的速度。如果您正在处理大量筛选表达式,其中筛选占用大部分时间,这将非常有用。
英文:
Memgraph has the ability to load custom functions written in C/C++ or Python. This custom functions then can be called from any Cypher expressions. Semantically spekaing, functions should be a small fragment of functionality that con't require long computations and large memory consumption. There is one limitation in place: the only requirement for functions is not to modify the graph.
Memgraph MAGE has many pre-defined functions as a part of the MAGE project. In addition to MAGE off-the-shelf functions, you also can optimize performance because, e.g., precompiled C++ functions can massively increase filter expression speed. This will be very useful if you are working with large filter expressions where filtering takes most of the time.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论