All entity metadata is retrieved with a single DB call (metadata is preloaded, and not loaded on demand). The second option will generate more queries.
Thanks for your quick response.
Do you mean all metadatas of all entities are retrieved with a single DB call ?
Elgg maintains an in-memory (during the request) cache of metadata. Whenever entities are fetched, the cache is fully populated for those entities, with a single query.
But if you do 10 separate get_entity() calls, at worst that might produce 10 metadata queries. So batch up entities fetches if you can, and use the prefetch_* options where it makes sense.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.