Fetching 4000 items?

Author Message

Jorge estévez

Tuesday 06 October 2009 7:30:37 am

Hello,

I have uploaded lots of images to Media, each one of them named with a unique product code. There are 4000 images.

When I display a product I must fetch images (already uploaded at media) compare the product's code with the image name and show the image at the browser page.

Fetching so many images to iterate and compare to the product's name is time and resource consuming.

Is there any other solution worth trying?

Fetch node where name is CODE-XXXX, as images have unique names? Could something like this be efficient?

Any help... thanks!

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Tero Auralinna

Tuesday 06 October 2009 9:19:52 am

Attribute filter will do the trick.

Something like this

{def $images = fetch( 'content', 'list',
        hash( 'parent_node_id', 51, 'attribute_filter', array( array( 'image/name','=', 'CODE-XXXX' ) ) ) )}

NXC Finland - Open Source solutions, Internet marketing and web analytics
http://www.nxc.fi
http://www.auralinna.fi
http://twitter.com/teroauralinna

Gaetano Giunta

Tuesday 06 October 2009 9:31:20 am

You might as well consider:

- using an object relation(s) attribute to link images to products

- add a secondary location to existing images so that they become children of the corresponding products

Basically trading editing time for faster access...

Principal Consultant International Business
Member of the Community Project Board

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 30 2025 21:37:53
Script start
Timing: Jan 30 2025 21:37:53
Module start 'layout'
Timing: Jan 30 2025 21:37:53
Module start 'content'
Timing: Jan 30 2025 21:37:53
Module end 'content'
Timing: Jan 30 2025 21:37:53
Script end

Main resources:

Total runtime0.0280 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 588.0078151.1953
Module start 'layout' 0.00630.0045 739.2031220.6719
Module start 'content' 0.01080.0156 959.8750997.7734
Module end 'content' 0.02640.0016 1,957.648433.9922
Script end 0.0280  1,991.6406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003010.5879140.0002
Check MTime0.00124.1587140.0001
Mysql Total
Database connection0.00103.450710.0010
Mysqli_queries0.002910.269630.0010
Looping result0.00000.046010.0000
Template Total0.00103.710.0010
Template load0.00082.884010.0008
Template processing0.00020.802510.0002
Override
Cache load0.00062.023610.0006
General
dbfile0.00155.383380.0002
String conversion0.00000.024740.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