Just a thing i had seen in a book talking about php speed, just add 'limit 1' in the query, then mysql stop searching at the first result found. There sould be only one I think.
Hope it helps
example : SELECT cur_id FROM cur WHERE cur_namespace=0 AND cur_title='List_of_Japan_relate...' LIMIT 1
-----Message d'origine----- De : Brion Vibber [mailto:brion@pobox.com] Envoyé : mercredi 1 octobre 2003 04:14 À : Wikimedia developers Objet : Re: [Wikitech-l] Profiling
Anybody wanna look into optimizing OutputPage::replaceInternalLinks()? It's a known troublemaker; it's got a bit loop that could probably be much much more efficiently done.
Rendering pages with lots and lots of links gets *really* slow.
-- brion vibber (brion @ pobox.com)
20031001020630 0025.562 /wiki/List_of_Japan_related_topics anon at 0000.016 in 0000.001 ( 0.0%) - main-misc-setup at 0000.017 in 0000.079 ( 0.3%) - *** wfQuery("SELECT cur_id FROM cur WHERE cur_namespace=0 AND cur_title='List_of_Japan_relate...") at 0000.017 in 0000.080 ( 0.3%) - ** LinkCache::addLink-checkdatabase at 0000.097 in 0000.013 ( 0.1%) - ** wfQuery("SELECT cur_text,cur_timestamp,cur_user,cur_counter,cur_restrictions,cur_touched ...") at 0000.112 in 0000.005 ( 0.0%) - *** wfQuery("SELECT cur_id FROM cur WHERE cur_namespace=0 AND cur_title='List_of_Japan-relate...") at 0000.111 in 0000.006 ( 0.0%) - ** LinkCache::addLink-checkdatabase at 0000.117 in 0000.118 ( 0.5%) - ** wfQuery("SELECT cur_text,cur_timestamp,cur_user,cur_counter,cur_touched FROM cur WHERE cu...") at 0000.017 in 0000.218 ( 0.9%) - * Article::getContent at 0000.237 in 0003.250 (12.7%) - ** wfQuery("SELECT cur_id,cur_namespace,cur_title FROM cur,links WHERE cur_id=l_to AND...") at 0003.582 in 0000.013 ( 0.0%) - ** wfQuery("SELECT bl_to FROM brokenlinks WHERE bl_from='200203'...") at 0000.237 in 0003.358 (13.1%) - * LinkCache::preFill at 0003.597 in 0000.001 ( 0.0%) - *** OutputPage::removeHTMLtags at 0003.598 in 0000.002 ( 0.0%) - *** OutputPage:replaceVariables at 0003.634 in 0000.009 ( 0.0%) - *** OutputPage::doBlockLevels at 0003.657 in 0000.111 ( 0.4%) - *** OutputPage::replaceExternalLinks at 0003.768 in 0000.006 ( 0.0%) - **** OutputPage::replaceInternalLinks-setup at 0003.774 in 0016.715 (65.4%) - **** OutputPage::replaceInternalLinks-loop at 0003.768 in 0016.721 (65.4%) - *** OutputPage::replaceInternalLinks at 0003.597 in 0016.925 (66.2%) - ** OutputPage::doWikiPass2 at 0003.595 in 0016.928 (66.2%) - * OutputPage::addWikiText at 0000.017 in 0020.506 (80.2%) - Article::view at 0020.523 in 0000.000 ( 0.0%) - * OutputPage::output-headers at 0020.524 in 0000.000 ( 0.0%) - ** Skin::initPage at 0020.524 in 0000.009 ( 0.0%) - ** Skin::doBeforeContent at 0020.524 in 0000.010 ( 0.0%) - * OutputPage::output-middle at 0020.534 in 0004.993 (19.5%) - * OutputPage::output-bodytext at 0025.531 in 0000.001 ( 0.0%) - **** wfQuery("SELECT cur_id FROM cur WHERE cur_namespace=1 AND cur_title='List_of_Japan-relate...") at 0025.530 in 0000.002 ( 0.0%) - *** LinkCache::addLink-checkdatabase at 0025.552 in 0000.001 ( 0.0%) - ***** wfQuery("SELECT cur_id FROM cur WHERE cur_namespace=1 AND cur_title='List_of_Japan-relate...") at 0025.551 in 0000.002 ( 0.0%) - **** LinkCache::addLink-checkdatabase at 0025.543 in 0000.019 ( 0.1%) - *** Skin::quickBar at 0025.527 in 0000.035 ( 0.1%) - ** Skin::doAfterContent at 0025.527 in 0000.035 ( 0.1%) - * OutputPage::output-after at 0020.523 in 0005.039 (19.7%) - OutputPage::output
_______________________________________________ Wikitech-l mailing list Wikitech-l@Wikipedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l