Open
Description
Bug description
When using fieldtype entries with an empty field value, the system queries ALL collections instead of limiting the scope to the configured collection.
Current behavior:
- With attached entry: Debugbar shows specific query for selected entry only
- With empty field: Debugbar shows queries across ALL collections, potentially impacting performance
Expected behavior:
Queries should be limited to the configured collection scope even when the field is empty.
Key Question:
Does this "empty field" scenario trigger a full reindexing process across all collections in the flat-file system? If so, what are the performance implications and recommended approaches to handle this?
Looking forward to your insights on this behavior.
Thanks, Yuri
How to reproduce
- Create a new site using statamic-cli
- Add fieldtype entries field to the 'pages' collection
- Configure the field to accept entries from 'posts' collection
- View the entry with empty field in Control Panel
- Check Debugbar queries
Logs
No response
Environment
- Statamic Version: 5.38.1
- PHP Version: 8.3.8
- Installation: Fresh statamic/statamic site via CLI
- Laragon
Installation
Fresh statamic/statamic site via CLI
Additional details
No response