Hello Fez developers,


we successfully indexed 5800 fulltext documents in Fez 1.3/Fedora 2.2.1. The standard homepage (index.php) needs over 2.5s to process. I found out that this is because of the “Recently added” section (which is displaying 3 documents). Further, the query for matching the fields and getting the information already takes 1.2 seconds on the MySQL Server alone. Here’s a copy of this query:


SELECT r1.*, x1.*, s1.*, k1.*, d1.* , DAYNAME(convert_tz(display.sort_column,'+00:00','+01:00')) as day_name FROM fedora21.fez_record_matching_field r1 INNER JOIN fedora21.fez_xsd_display_matchfields x1 ON r1.rmf_xsdmf_id = x1.xsdmf_id INNER JOIN ( SELECT distinct r2.rmf_rec_pid, r5.rmf_date as sort_column FROM fedora21.fez_record_matching_field r2 inner join fedora21.fez_xsd_display_matchfields AS x2 on r2.rmf_xsdmf_id = x2.xsdmf_id and r2.rmf_int=2 and x2.xsdmf_element='!sta_id' inner join fedora21.fez_record_matching_field r5 on r5.rmf_rec_pid = r2.rmf_rec_pid inner join fedora21.fez_xsd_display_matchfields x5 on r5.rmf_xsdmf_id = x5.xsdmf_id inner join fedora21.fez_search_key AS s5 on s5.sek_id = x5.xsdmf_sek_id and s5.sek_title = 'Created Date' AND DATE_SUB(UTC_DATE(), INTERVAL 6 DAY) < r5.rmf_date order by sort_column DESC , r2.rmf_rec_pid desc limit 0, 3 ) as display on display.rmf_rec_pid = r1.rmf_rec_pid LEFT JOIN fedora21.fez_xsd_loop_subelement s1 ON (x1.xsdmf_xsdsel_id = s1.xsdsel_id) LEFT JOIN fedora21.fez_search_key k1 ON (k1.sek_id = x1.xsdmf_sek_id) LEFT JOIN fedora21.fez_xsd_display d1 ON (d1.xdis_id = r1.rmf_int and k1.sek_title = 'Display Type') ORDER BY display.sort_column DESC , r1.rmf_rec_pid DESC 


I wonder whether anything can be done about the 2.5 seconds or if that’s “by design”. I’m not yet enough into Fez to rewrite the query myself. What steps could be done to get those 2.5 seconds to less than half a second (which it should actually be) ? Optimize the query or optimize MySQL structures?



Regards, Kai




Kai Jauslin, Dipl. Informatik-Ing. ETH, ETH Zürich, ETH-Bibliothek, Rämistrasse 101, CH-8092 Zürich

kai.jauslin@library.ethz.ch, Tel +41-44-6324972, Büro STB F19