Upsert gets slow on tables with many columns
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- databases, performance
Research direction
Start with pyiceberg.table.upsert_util.get_rows_to_update and run the provided PyArrow reproduction with 20,000 rows and 200 columns. Compare the current behavior on unchanged tables and trace where matched rows are compared; done means the no-change upsert comparison avoids the reported column-dependent slowdown while preserving the expected rows to update.
Written by the indexing model from the issue text.
Description
Feature Request / Improvement
upsert compares the matched rows one cell at a time, so it gets slower with every extra column, not just with every extra row.
On a table with 200 columns, comparing 20k matched rows takes around 20 seconds on my machine, before anything is written.
To reproduce:
import time
import pyarrow as pa
from pyiceberg.table.upsert_util import get_rows_to_update
rows, cols = 20_000, 200
table = pa.table({"pk": pa.array(range(rows)), **{f"c{i}": pa.array([float(i)] * rows) for i in range(cols)}})
start = time.monotonic()
get_rows_to_update(table, table, ["pk"]) # nothing has changed
print(time.monotonic() - start)
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 589
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 70
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iceberg-python
-
kind:bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
apache/iceberg-python#4006 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/iceberg-python#3996 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/iceberg-python#3979 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/iceberg-python#3885 ·
-
[Bug] PyArrowFileIO fails to propagate s3.ssl.ca-cert to pyarrow.fs.S3FileSystem tls_ca_file_path Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/iceberg-python#3866 · 1 comment ·
All issues in apache/iceberg-python
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
StevenBlack/hosts#3256 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
qualcomm/qai-appbuilder#275 ·