Smart resolution skipping — skip file reads for metadata-only queries
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Domain
- backend, databases, performance
Research direction
Start by tracing resolve_content() through query(), then inspect how WordPress applies the posts_fields filter and the_content filter for WP_Query results. Compare metadata-only cases such as fields = 'ids', REST _fields requests, and admin listings. Done means those queries avoid unnecessary file reads while content is still resolved when the_content or post content is actually needed.
Written by the indexing model from the issue text.
Description
Problem
Currently, resolve_content() fires for every SELECT on wp_posts that includes post_content (which is most queries, since WordPress uses SELECT *). This means even admin list tables and count queries trigger file reads, even though they don't display content.
Proposed solution
Phase 4 of the Index/Map Architecture:
- Detect metadata-only queries: queries where content is selected but never used (admin list tables, REST collection endpoints with
_fields, WP_Query withfields => 'ids') - Use the
posts_fieldsfilter: WordPress fires this filter on WP_Query — we can detect when content is excluded - Lazy-lazy resolution: instead of resolving content in
query(), resolve it inthe_contentfilter or when$post->post_contentis first accessed
Impact
Low priority — file reads are ~0.1ms each. For a listing page with 20 posts, that's 2ms total. But for admin pages with 100+ posts, it adds up.
Context
Phase 4 of the Index/Map Architecture (PR #41).
- Dominant language
- PHP
- Stars
- 5
- Forks
- 1
- Avg merge
- 1h 41m
- Merged PRs (30d)
- 159
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
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 Automattic/markdown-database-integration
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Automattic/markdown-database-integration#424 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
Automattic/markdown-database-integration#420 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Automattic/markdown-database-integration#415 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
Automattic/markdown-database-integration#414 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Automattic/markdown-database-integration#401 ·
Maintainers usually reply within 1 day
All issues in Automattic/markdown-database-integration
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
sync-en
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
[Area] REST API [Type] Documentation Good First Issue
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
WordPress/presence-api#584 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100