简体   繁体   English

cx_oracle与sqlalchemy性能对比

[英]cx_oracle and sqlalchemy performance comparison

I am working oracle database and wanted to know which toolkit (sqlalchemy or cx_Oracle) is better in performance as I can't see any comparisons online I hope someone can help me.我正在使用 oracle 数据库,想知道哪个工具包(sqlalchemy 或 cx_Oracle)的性能更好,因为我在网上看不到任何比较,希望有人能帮助我。 I have listed the key performance indicators that I need to be addressed.我列出了我需要解决的关键绩效指标。

Bulk insertion and single line insertion
connections complexity
which one can be used for streaming more efficiently
Which one is better for OLTP connections (loading data from OLTP with that toolkit) 

However more that these comparisons are highly appreciated然而,更多的是这些比较受到高度赞赏

My Target and Source databases are Oracle我的目标和源数据库是 Oracle

A comparison of the cx_oralce and sqlalchemy cx_oralce 和 sqlalchemy 的比较

SQLAlchemy is a layer on top of cx_Oracle so it will always have more overhead. SQLAlchemy 是 cx_Oracle 之上的一层,因此它总是有更多的开销。

When looking for performance, you should evaluate the latest cx_Oracle release (now called python-oracledb) since the new Thin mode has some advantages (eg with DB Object types ).在寻找性能时,您应该评估最新的 cx_Oracle 版本(现在称为 python-oracledb),因为新的精简模式具有一些优势(例如, DB Object 类型)。 See the release announcement for information about python-oracledb.有关 python-oracledb 的信息,请参阅发布公告 Also see this blog post about using SQLAlchemy 1.4 with python-oracledb.另请参阅这篇关于将 SQLAlchemy 1.4 与 python-oracledb 结合使用的文。

Fundamentally, you need to decide which coding style (ORM or raw API calls) you want to use.从根本上说,您需要决定要使用哪种编码风格(ORM 或原始 API 调用)。 You may also want to look at pandas, which uses SQLAlchemy. And you should benchmark in your own environment with your own code.您可能还想看看 pandas,它使用 SQLAlchemy。您应该在自己的环境中使用自己的代码进行基准测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM