Fetching several objects at a time

Author Message

Leif Arne Storset

Friday 02 June 2006 7:45:13 am

Is it possible to fetch several objects in one operation?

I have a list of object IDs, and need to fetch all of the corresponding objects. I'm thinking that iterating through the list, fetching each one separately, is woefully inefficient, with one SQL query for each iteration.

It would be theoretically possible (in the general case) to fetch multiple objects in one query using the OR operator in SQL, but I'm not sure whether eZ publish's structure allows this, not to mention its template API.

And before you ask, no, I am not trying to fetch children of multiple nodes (fetch ( 'content', 'list' )) - I want the objects themselves, not their node children. :)

Leif Arne Storset

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:03:09
Script start
Timing: Jan 18 2025 02:03:09
Module start 'layout'
Timing: Jan 18 2025 02:03:09
Module start 'content'
Timing: Jan 18 2025 02:03:09
Module end 'content'
Timing: Jan 18 2025 02:03:09
Script end

Main resources:

Total runtime0.0219 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0096 589.1328152.6250
Module start 'layout' 0.00970.0037 741.757839.4453
Module start 'content' 0.01330.0064 781.203185.2422
Module end 'content' 0.01970.0021 866.445330.3047
Script end 0.0218  896.7500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003315.1654140.0002
Check MTime0.00156.8587140.0001
Mysql Total
Database connection0.00114.885010.0011
Mysqli_queries0.003716.733430.0012
Looping result0.00000.077410.0000
Template Total0.00178.010.0017
Template load0.00114.939510.0011
Template processing0.00073.022610.0007
Override
Cache load0.00073.264710.0007
General
dbfile0.00135.850080.0002
String conversion0.00020.722940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs