Forums / Setup & design / Fetching several objects at a time

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

eZ debug

Timing: Jan 18 2025 01:03:04
Script start
Timing: Jan 18 2025 01:03:04
Module start 'content'
Timing: Jan 18 2025 01:03:04
Module end 'content'
Timing: Jan 18 2025 01:03:04
Script end

Main resources:

Total runtime0.0233 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 589.1641180.8281
Module start 'content' 0.00770.0089 769.992289.7891
Module end 'content' 0.01660.0066 859.781366.7031
Script end 0.0232  926.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002812.1111120.0002
Check MTime0.00125.3041120.0001
Mysql Total
Database connection0.00104.074210.0010
Mysqli_queries0.003615.325540.0009
Looping result0.00000.107320.0000
Template Total0.006126.310.0061
Template load0.00083.384110.0008
Template processing0.005322.907410.0053
Override
Cache load0.00052.259510.0005
General
dbfile0.004820.7155100.0005
String conversion0.00000.029630.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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