Cannot sort by attribute value and query by another.

Author Message

Jason M

Wednesday 10 December 2003 11:54:04 am

After reviewing the sql that is output by the following fetch:

fetch(content, list,
hash(
parent_node_id, 55,
depth, 3,
offset, $view_parameters.offset,
limit, 1,
attribute_filter, array('and', array('183', '=' , $content_version.data_map.short_name.content)),
sort_by, array(attribute,true(),185)
)
)

I believe this to be a limitation in EZ. Am I wrong by assuming this?

Here is the sql output as well:

SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name
, ezcontentobject_name.name as name, ezcontentobject_name.real_translation
FROM
ezcontentobject_tree,
ezcontentobject,ezcontentclass
, ezcontentobject_name
, ezcontentobject_attribute as a0


WHERE
path_string like '/1/2/55/%' and depth <= 5 and


a0.contentobject_id = ezcontentobject.id AND
a0.contentclassattribute_id = 185 AND
a0.version = ezcontentobject_name.content_version AND

a0.contentobject_id = ezcontentobject.id AND
a0.contentclassattribute_id = 183 AND
a0.version = ezcontentobject_name.content_version AND
( a0.sort_key_string = 'usedauto' ) AND
ezcontentclass.version=0 AND
node_id != 55 AND
ezcontentobject_tree.contentobject_id = ezcontentobject.id AND
ezcontentclass.id = ezcontentobject.contentclass_id AND

ezcontentobject_tree.contentobject_is_published = 1
and ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
ezcontentobject_name.content_translation = 'eng-GB'
AND ((ezcontentobject.contentclass_id in (1,10,11,12,13,14,15,17,19,2,20,21,5,6,7,8,9)))
ORDER BY a0.sort_key_string ASC
LIMIT 0, 1

I am simply trying to query auto rates. I'm looking in the loan rate class for the name attribute = 'usedauto' and hoping to sort by apr and limit 1 to get the lowest rate of the usedautos. The function works when the sort_by and attribute_filter_array are used independently of each other, but not together in the same fetch. Any thoughts?

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 00:29:04
Script start
Timing: Jan 19 2025 00:29:04
Module start 'layout'
Timing: Jan 19 2025 00:29:04
Module start 'content'
Timing: Jan 19 2025 00:29:05
Module end 'content'
Timing: Jan 19 2025 00:29:05
Script end

Main resources:

Total runtime0.8506 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.0048 588.0625152.6406
Module start 'layout' 0.00480.0027 740.703139.4766
Module start 'content' 0.00750.8415 780.1797414.1406
Module end 'content' 0.84900.0015 1,194.32038.1250
Script end 0.8505  1,202.4453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3913160.0002
Check MTime0.00140.1595160.0001
Mysql Total
Database connection0.00070.081410.0007
Mysqli_queries0.805994.7493460.0175
Looping result0.00050.0609440.0000
Template Total0.819096.320.4095
Template load0.00260.301620.0013
Template processing0.816495.987820.4082
Template load and register function0.00020.026610.0002
states
state_id_array0.00140.170310.0014
state_identifier_array0.00110.133820.0006
Override
Cache load0.00210.2502520.0000
Sytem overhead
Fetch class attribute can translate value0.00060.069510.0006
Fetch class attribute name0.00060.071110.0006
XML
Image XML parsing0.00010.012010.0001
class_abstraction
Instantiating content class attribute0.00000.000610.0000
General
dbfile0.00060.0653100.0001
String conversion0.00000.000640.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
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs