Multiple filters on search, good design suggestions?

Author Message

HÃ¥vard Bell

Thursday 18 November 2004 1:56:41 pm

Hi,

We are building a web site that has a number of courses. Each course is held at a certain place, is of a certain type, and is thought by a certain person. We want to list all courses at this place, or all courses of this type, or all courses thought by this person.

For example: Course A is held in Oslo, thought by Adam, and is of type Advanced. Course B is held in New York, thought by Adam and is of type Beginner. Course A and Course B will show up on the list of courses thought by Adam. Only course A will show up on the list of courses held in Oslo, and so fourth.

Initially we have designed the object model such that each course has attributes that are object relations to place object, person object or coursetype object. The problem with this is that in one fetch statement, we cannot filter based on some values in an object related to through a related object attribute.

A solution is to fetch all courses, then we filter out what we need, manually, through a loop in the template. This feels, at least now, problematic with regards to performance if the course list is large.

Does anybody have any good suggestions on how we can solve this in the most efficient, and "eZ Publish like" way?

Thanks,

~ Hav.

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 19 2025 04:37:12
Script start
Timing: Jan 19 2025 04:37:12
Module start 'layout'
Timing: Jan 19 2025 04:37:12
Module start 'content'
Timing: Jan 19 2025 04:37:14
Module end 'content'
Timing: Jan 19 2025 04:37:14
Script end

Main resources:

Total runtime1.5836 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 589.3828152.6406
Module start 'layout' 0.00780.0056 742.023439.4766
Module start 'content' 0.01351.5685 781.5000400.3672
Module end 'content' 1.58200.0016 1,181.86728.1250
Script end 1.5836  1,189.9922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2234160.0002
Check MTime0.00140.0890160.0001
Mysql Total
Database connection0.00090.056510.0009
Mysqli_queries1.543697.4696460.0336
Looping result0.00040.0280440.0000
Template Total1.547097.720.7735
Template load0.00220.142020.0011
Template processing1.544797.542320.7724
Template load and register function0.00030.016110.0003
states
state_id_array0.00100.060910.0010
state_identifier_array0.00100.065220.0005
Override
Cache load0.00180.1139110.0002
Sytem overhead
Fetch class attribute can translate value0.00070.044210.0007
Fetch class attribute name0.00050.030710.0005
XML
Image XML parsing0.00010.006410.0001
class_abstraction
Instantiating content class attribute0.00000.000210.0000
General
dbfile0.00070.0455100.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 4
 Number of unique templates used: 4

Time used to render debug report: 0.0001 secs