Smarter replacement checks for columns
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- sql
- 领域
- cli, databases, performance
调研方向
The issue names no files or tests; begin by tracing the search-replace command's column selection and SQL generation using the wp_posts example and its --skip-columns options. Done means the command can safely identify columns that do not need replacement while preserving expected replacements and improving the reported runtime.
由索引模型根据 Issue 内容生成。
描述
Feature Request
- Yes, I reviewed the contribution guidelines.
Describe your use case and the problem you are facing
I have been actively trying to increase the velocity on my own URL S&Rs. To benchmark/diagnose how I could make them faster I started watching the SQL connections on large, test DBs with about 20gb worth of database rows living in wp_posts.
What I tended to notice are queries like the following:
UPDATE `wp_posts` SET `post_status` = REPLACE(`post_status`, 'http://dontmatter.co/', 'http://dontmatter.test/')
basically S&R is trying to replace on a column we can say confidently is not going to hold something I'd like to replace. One way around this is skipping these checks is to skip on this particular column. In my benchmarks case I skipped the following:
docker-compose run --rm wpcli wp search-replace --url=http://dontmatter.co/ 'http://dontmatter.co/' 'http://dontmatter.test/' wp_posts --recurse-objects --skip-columns=post_title,post_excerpt,post_status,comment_status,post_password,post_name,to_ping,pinged,guid,post_type,post_mime_type
a command that used to take me 32 minutes to execute now takes me 7 minutes with these changes.
Describe the solution you'd like
While I could do this for every single table in WP on my own, I feel this could be easier by being smarter about what columns we could skip automatically. Like we're never going to see something we'd like to replace on columns that act as binaries or columns that are like enums such as post_type that are all typed as varchar in the db.
- 主要语言
- Gherkin
- 星标
- 61
- 派生
- 47
- 平均合并
- 8 分钟
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
wp-cli/search-replace-command 的其他 Issue
-
bug command:search-replace scope:distribution state:unconfirmed
难度 4/5 3-5 天 新手友好度 45/100
wp-cli/search-replace-command#231 · 5 条评论 ·
-
command:search-replace contributor-day
难度 5/5 一周以上 新手友好度 25/100
wp-cli/search-replace-command#186 · 2 条评论 · 11 个 reaction ·
-
command:search-replace
难度 4/5 3-5 天 新手友好度 35/100
wp-cli/search-replace-command#142 · 5 条评论 · 2 个 reaction ·
-
command:search-replace
难度 3/5 1-2 天 新手友好度 52/100
wp-cli/search-replace-command#137 · 6 条评论 · 4 个 reaction ·
-
Progress bar 未关闭command:search-replace
wp-cli/search-replace-command#134 · 1 条评论 · 6 个 reaction · 已指派 1 人 ·
查看 wp-cli/search-replace-command 的全部 Issue
相似的 Issue
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/skills#1811 · 1 条评论 ·
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
难度 2/5 1-3 小时 新手友好度 75/100
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
CachyOS/distribution#587 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
datalayer/mcp-compose#42 ·