Hi !!
Yes, this is due the current caching architecture which stores all headers of a folder in one DB record. If you have thousands of headers, the SQL query will make MySQL hang. This is subject to be redesigned and we already had some good posts from Ivan alias DrSlump.
just looking at _list_headers i noticed that deleted headers are also cached, is there any reason for that ?
ok, but is there any need to cache also headers which are deleted ? i mean:
if (!is_array($a_msg_headers) || sizeof($a_msg_headers) != $max) { $a_header_index = iil_C_FetchHeaders($this->conn, $mailbox, "1:$max"); $a_msg_headers = array(); foreach ($a_header_index as $i => $headers) $a_msg_headers[$headers->uid] = $headers; }
could be changed to:
foreach ($a_header_index as $i => $headers)
if (!$headers->deleted)
$a_msg_headers[$headers->uid] = $headers;