Skip to content

optimize excel update import: query only needed columns instead of select * - #910

Open
AlexCXC wants to merge 1 commit into
masterfrom
opt-update-from-excel/csv
Open

optimize excel update import: query only needed columns instead of select *#910
AlexCXC wants to merge 1 commit into
masterfrom
opt-update-from-excel/csv

Conversation

@AlexCXC

@AlexCXC AlexCXC commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@seafile-dev seafile-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve

复核任务详情后,limit=50000 是既有的最多扫描行数,不属于本次改动要求;本任务的目标是将 SELECT * 收敛为匹配键、可更新导入列和 _id。当前改动已在预检及提交更新路径使用同一列选择逻辑,避免查询无关的公式、链接等列。

备注:本 PR 未新增自动化回归测试;建议后续为列选择逻辑补充覆盖,但这不阻塞本次性能优化。



def get_rows_from_dtable_db(dtable_db_api, table_name, limit=50000):
def get_rows_from_dtable_db(dtable_db_api, table_name, limit=50000, columns=None):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Critical] 未将查询总量限制为 1 万

Why this matters:
这里仍保留 limit=50000,循环会按每页 10000 行继续请求至多五页。需求要求正常路径使用 LIMIT 1 万;在大表或复杂公式表中,累计读取 5 万行即使只查询必要列,预检和提交更新仍可能触发 execution cost exceeded,优化目标无法保证达成。

Suggested fix: 将此更新导入路径的总上限改为 10000(或显式传入该值),使正常路径只执行一次 1 万行查询;1 千行降级策略可按任务说明后续实现。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复核更正:任务详情仅要求将查询从 SELECT * 收敛为必要列,并未要求把既有的最多 5 万行扫描上限改为 1 万行。当前实现已将匹配键、可更新导入列和 _id 传入查询;本线程中的“总量限制为 1 万”不应作为本次 PR 的阻塞项。

@seafile-dev seafile-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复核确认:本次改动符合任务目标。预检与实际提交更新均只查询匹配键、可更新导入列和 _id,避免无关公式、链接等列参与 SQL 计算。此前关于将总量限制为 1 万行的意见不属于当前任务范围,已在先前审查说明中更正。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants