ConnectorX runs your query inside a subquery twice, and prints 21x next to 13x
Fastest library to load data from DB to DataFrames in Rust and Python
At a glance
- What is it?
- ConnectorX is a Rust library that pulls database tables into Pandas, Arrow, Polars and Dask. Its performance section offers two speed multipliers without naming a baseline for one of them, and its partitioning help rests on arithmetic over two endpoints that assumes the rows are spread evenly.
- Who is it for?
- Worth reaching for when the table is large and the bottleneck is the transfer, and worth measuring yourself first, because the numbers printed in the performance section do not come with a readable chart or a named baseline for the larger one.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- sfu-db/connector-x2,665 ★ · +8
| Repository | 2026-10-04 | 2026-11-25 |
|---|---|---|
| sfu-db/connector-x | 2.7k | 2.7k |
8 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Two speed multipliers share one sentence
The performance section loads a ten times scaled TPC-H lineitem table, 8.6GB, out of Postgres with four cores of parallelism, then says ConnectorX uses up to three times less memory and twenty-one times less time, and in the parenthesis immediately narrows that to three times less memory and thirteen times less time compared with Pandas. Only the second figure gets a baseline named. The twenty-one is left hanging with no rival attached to it, so a reader cannot work out what it is measured against, and both numbers carry the words up to without any table showing how far the range goes. The two charts that sit right under those sentences are headings with nothing in them. One is headed Time chart, lower is better and one is headed Memory consumption chart, lower is better, and under each there is one empty centered paragraph tag. No axis, no bar, no measurement, no table of raw numbers. The method does survive elsewhere: the claim links into Benchmark.md, which pins the comparison to an AWS r5.4xlarge, and a separate address under Historical Benchmark Results holds older runs. So the reproducibility trail exists in the repository, while the page you land on gives you the conclusion without the shape of the data behind it.
The count query runs your query again
Before a single row moves, ConnectorX spends several round trips on the database. First it fetches the schema of the result set, which depending on the source may mean issuing a limit zero probe. Then, when a partition column is given, it asks for the endpoints of that column. Then it counts rows. The two that cost real work both wrap your original query in a subquery:
SELECT MIN($partition_on), MAX($partition_on) FROM (SELECT * FROM lineitem)
SELECT COUNT(*) FROM (SELECT * FROM lineitem)So the database evaluates that subquery twice before any partitioned data query starts, once to produce two numbers and once to produce one. Those results are not decoration. The schema and the count together are what let the library size its destination allocation before the download starts, and the count for each partition is what tells it how much space to reserve. Every boundary is then cut the same way, with the count repeated per partition:
SELECT * FROM (SELECT * FROM lineitem) WHERE $partition_on > 0 AND $partition_on < 10000
SELECT COUNT(*) FROM (SELECT * FROM lineitem) WHERE $partition_on > 0 AND $partition_on < 10000The one line introduction is:
import connectorx as cx
cx.read_sql("postgresql://username:password@server:port/database", "SELECT * FROM lineitem")and the partitioned form adds two arguments:
cx.read_sql("postgresql://username:password@server:port/database", "SELECT * FROM lineitem", partition_on="l_orderkey", partition_num=10)Count what that buys. The unpartitioned call spends a schema probe and one count on the wrapped query. The partitioned call adds a min and max pass over the same wrapped query, then one count per partition over a wrapped query whose filter has narrowed it. On a column where the filter matches nothing for several slices, those counts are cheap and the allocation is small. On a column where one slice holds the table, the counts still walk the whole subquery. The stated reason the library is written in Rust is a zero-copy design. The project argues that existing solutions copy data several times over during a download and that data intensive work done in Python carries its own cost, so the architecture aims to copy the data exactly once from source to destination and credits cache and branch predictor friendliness for making full use of the CPU. None of those claims are measured in the same section as the time and memory figures.
Evenly splitting is arithmetic on two endpoints
The partitioned call promises to split the specified column evenly across the requested number of partitions. What the endpoint queries can actually do is read the smallest value, read the largest value, and divide the interval between them. Those two things agree only when the values are spread out evenly. If most rows sit in one band, and that is usually the reason a single partition is slow in the first place, the slices come out badly unbalanced and the work lands on one thread while the others wait. Nothing in the project reports the skew it just measured, so a query can return silently under parallel execution and look like a slow server. The same passage narrows the feature three times without widening it anywhere else. Partitioning works on numerical columns. Those columns cannot contain NULL. And it applies to what the text calls SPJA queries, a term that appears without a definition anywhere in the project description, so what the restriction excludes cannot be worked out from what is written here. Once both arguments are set, one thread is assigned per partition, and each thread writes returned rows to the destination row wise or column wise depending on the database.
Cross database joins have no stated execution site
Federated queries are labelled experimental, and the interface changes shape: the first argument becomes a dict of named connections rather than one connection string.
db1 = "postgresql://username1:password1@server1:port1/database1"
db2 = "postgresql://username2:password2@server2:port2/database2"
cx.read_sql({"db1": db1, "db2": db2}, "SELECT * FROM db1.nation n, db2.region r where n.n_regionkey = r.r_regionkey")The whole explanation is one sentence, which says that by default all joins from the same data source are pushed down. A join between db1 and db2 is by definition not a join from one data source, and the sentence says nothing about where that join is evaluated instead. The text available here does not say, and that gap is the whole question for anyone planning a cross database join. What is visible is the naming. The keys of the dict become the prefixes used in the SQL, so the string you type into the connection dict is part of the query text you have to keep correct. The example joins with a comma in the from list and a filter in the where clause rather than an explicit join keyword. Setup and the remaining configuration are handed off to Federation.md in the repository root, so the experimental feature has a document, but the main description gives it one example and one sentence.
Eleven checked boxes, eight wire protocols
The source list shows eleven ticked entries. Three of them are other databases reached through somebody else's protocol: Mariadb through the mysql protocol, Redshift through postgres, and Azure SQL Database through mssql. Remove the duplicates and what remains is Postgres, Mysql, Sqlite, Clickhouse, SQL Server, Oracle, Big Query and Trino, eight distinct ways in for eleven names. That distinction is not cosmetic, because the download threads write row wise or column wise depending on the database, and no entry in the list says which direction each of the eleven uses. ODBC sits in the same list unticked and marked work in progress, and the line beneath it is a literal ellipsis rather than a roadmap, so the boundary between planned and shipped is a checkbox and three dots. Every connection string, every supported protocol and every data type is deferred to the databases page on the documentation site. The consequence inside the repository is that there is no Oracle example, no Clickhouse example, no Trino example and no Big Query example to copy, even though four of the eleven names are databases most people cannot reach through a plain URL.
Five destinations, two native paths
The destination list has five ticked entries and three of them name the path they arrive through. Modin is reached through Pandas. Dask is reached through Pandas. Polars is reached through PyArrow. That leaves Pandas and PyArrow as the only places where data is actually written, so picking between five destinations is closer to picking between two memory layouts and then putting a different dataframe front end on top. The Rust side of the project reads the same way. The workspace manifest pins arrow at version 56 with the prettyprint and ffi features and pins polars at 0.49 alongside polars-arrow, all three as workspace dependencies rather than optional ones, so both array engines are resolved for the whole workspace whatever a given entry point uses. The workspace members are connectorx and connectorx-cpp, with connectorx as the default member. A C++ target is listed in the tree and carries no build or usage instructions in the main description. Nothing in the destination list says whether mixed types, null handling or a column that the source returns in a different width than the target expects are converted, and those are the cases where going through Pandas behaves differently from going through Arrow.
debug = true sits in the release profile
The release profile in the workspace manifest sets debug info on alongside link time optimisation.
[profile.release]
debug = true
lto = trueOptimised builds therefore keep their symbols, which is a reasonable trade for profiling a data loader and a surprising one to find in a release profile without reading it. The rest of the same file states the project's centre of gravity: link time optimisation is on, the resolver is pinned at version 2, and two heavyweight array engines sit at the workspace level rather than being left to each crate to pull in. The names around the package do not line up either. The repository directory is connector-x with a hyphen. The install section says to run pip install connectorx. Every example imports connectorx as cx. The Rust crate name is connectorx. Four spellings for one library, and the hyphen only survives in the directory name, which means documentation, scripts and issues that refer to the library have to pick one spelling and hope the reader knows which.
The plan is a link to a forum thread
Three releases show up in the project's release history: v0.4.4 dated 2025-08-26, v0.4.5 dated 2026-01-18, and v0.4.6 dated 2026-09-18. That is a gap of about five months, then a gap of about eight months, and the version has stayed in the 0.4 series the whole way, so nothing here has shipped a 1.0. The last push to the default branch is dated 2026-09-23, five days after v0.4.6 was tagged, which is recent enough that the project is not sitting still. The section headed Next Plan contains no plan. It points at the Discussions page and invites readers to help decide what comes next, and the list of planned data sources lives on discussion thread 61 rather than in a file. So the direction of the library is decided in a forum thread that gets no version stamp, and the source list itself carries the same uncertainty with its one unchecked box. Benchmarks are split across two homes, which is worth knowing before you quote a number: Benchmark.md in the repository root holds the current comparison that the performance claim links to, and a dev path on the documentation site holds historical results, so the two sets of numbers were produced at different times under different code. Adoption is tracked the same way. A section lists Polars, Dataprep and Modin as organizations and projects using the library, and asks readers who want to be added to reply on discussion thread 146, so the reference list is a thread rather than a file. The citation section starts a paper reference naming Xiaoying Wang, Weiyuan Wu, Jinze Wu, Yizhou Chen, Nick Zrymiak and a name that stops after three letters.
Editorial conclusion
Worth reaching for when the table is large and the bottleneck is the transfer, and worth measuring yourself first, because the numbers printed in the performance section do not come with a readable chart or a named baseline for the larger one. Before committing, check whether your partition column is numerical and free of NULL values, since a string key silently takes the single threaded path, and check whether the join you care about lives inside one database, because the federation feature is marked experimental and its configuration sits in a separate file. The build from source path is documented off the README, so if the pip wheel does not cover your platform you will be following a link rather than a recipe.
Frequently asked questions
What does ConnectorX need before it will partition a query?
The partition column must be numerical, it cannot contain NULL values, and partitioned queries are limited to what the project calls SPJA queries. That term is used without a definition, so what it rules out is not stated anywhere in the project description.
Can ConnectorX split a query on a string key or on a column with missing values?
No. Partitioning is documented as working on numerical columns that cannot contain NULL, so a text key falls back to the single threaded call.
Where does ConnectorX execute a join that spans two databases?
The project says that by default all joins from the same data source are pushed down, and stops there. A join between two named connections is not covered by that sentence, so the execution site is not stated.
Which ConnectorX destinations are written directly rather than through another engine?
Pandas and PyArrow are the direct targets. Modin and Dask are reached through Pandas, and Polars is reached through PyArrow.
Is ODBC supported by ConnectorX, and how many protocols back the eleven listed sources?
ODBC is left unticked and marked work in progress. Of the eleven ticked sources, Mariadb, Redshift and Azure SQL Database reuse the mysql, postgres and mssql protocols, leaving eight distinct protocols.
What is the pip package name for the ConnectorX library?
The install block says pip install connectorx, and every example imports connectorx as cx. The repository directory is written connector-x with a hyphen, while the crate name is connectorx.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/sfu-db-connector-x)Star history chart for your README
[](https://hysenlabs.com/projects/sfu-db-connector-x)Was this useful?