Wednesday 18 March 2009 6:51:19 am
Hello, I have a extended attribute filter:
<?php
class titleAndDescriptionFilter
{
/*!
Constructor
*/
function titleAndDescriptionFilter()
{
// Empty...
}
function createSqlParts( $params )
{
if (isset($params[0]) && trim($params[0]) != '') {
$sqlTables= ',ezcontentobject_attribute AS filterName
,ezcontentobject_attribute AS filterText';
$sqlJoins = ' filterName.contentobject_id = ezcontentobject.id AND
filterName.version = ezcontentobject.current_version AND
filterName.contentclassattribute_id = 323 AND
filterText.contentobject_id = ezcontentobject.id AND
filterText.version = ezcontentobject.current_version AND
filterText.contentclassattribute_id = 324 AND';
$sqlJoins .= " (LOWER(filterName.data_text) LIKE LOWER('%".$params[0]."%') OR ";
$sqlJoins .= "LOWER(filterText.data_text) LIKE LOWER('%".$params[0]."%')) AND ";
}
return array( 'tables' => $sqlTables, 'joins' => $sqlCond );
}
}
But I have a big performance problem. If I run fetch with thid filter my MySQL is fulloaded by minutes. After 5minutes of 100% load I kill thread. But if I try SQL in cli client, there is no problem and result of query is served in 0.1 second and faster. EZ Publish version is 4.0 I have no idea what is wrong. Thanks for help.
|